Hello there,
I need to calculate and append to a csv file the md5sum after certain fields.
I tried to find something easy to understand but I got stuck.
The below command replaces field $2 with it's hash
Code:
# echo "a|b|c|d|e|f|g|h|i|j" | awk -F '|' 'BEGIN { OFS = "|" }{command="echo "$2"|md5sum" ;command | getline $2; close(command);sub(/[[:blank:]].*/,"",$2); print $0}'
# a|3b5d5c3712955042212316173ccf37be|c|d|e|f|g|h|i|j
What I need, is to calculate the md5sum after the fields $2 $5 $9 and append to the file as first column.
Output example:
Code:
<md5sum(bei)>|a|b|c|d|e|f|g|h|i|j
Any help?
Thank you