Hi,
In files, I have a field Date Of Birth (DOB). After that line I need to add Date of Joining (DOJ)
DOB:19-Apr-1981
needs to become
DOB:19-Apr-1981
DOJ:20-Jun-2005
What can be a sed/perl line that can do it for me. Please note that DOB/DOJ I have in variables
I am doing in a sh script
'line' represents file name which has names of many files which need to be enhanced.
var1=`echo $line | cut -d ":" -f1`
var2=`echo $line | cut -d ":" -f2`
perl -e 'while (<>) { s/(DOB
/$1\/DOJ: $var2/g; print }' $var1.txt > $va
r1\_new.txt
var1 - filename
var2 - DOJ data
Please advise.