I have a csv file with data presented as follows
'&(||o||022344527||o||lonyfoe||o||Joe||o||Joe||o||Otieno
I'm trying to delete second column.
Output :
'&(||o||lonyfoe||o||Joe||o||Joe||o||Otieno
Any ideas?
This is what I have tried so far
cut -d'||o||' -f2 --complement
awk -F'||o||' '{
for(n=1; n<=NF; n++){
if(n!=NF)fmt="%s|"; else fmt="%s\n"
if(n!=2)printf(fmt,$n)
}
}'
but it doesn't work
If your Input_file is same as shown sample then following may help you on same:
awk '{sub(/\|\|o\|\|[0-9]+\|\|o\|\|/,"||o||")} 1' Input_file
Output will be as follows:
'&(||o||lonyfoe||o||Joe||o||Joe||o||Otieno
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With