I have a large data file and I need to append comma at the end of each line.How can I accomplish this? Thank you.Here is my sample data file as below.
1000050G8611
1000200G8611
1000250G8611
1000350G8611
1000375G8611
1000376G9403
1000475G8611
1000500G8611
1000550G8611
1000600G8611
1000610G8611
1000611G0807
1000612G0804
1000614G0802
1000617G8611
1000618G0710
1000619G8611
1000621G8611
1000624G0606
awk '{print $0 "," }' file > outFile
sed 's/$/,/' file > outFile
sed -i 's/$/,/' file
If your sed supports the -i option.
IHTH
This should do the trick
awk '{ print $0 "," }' < inputfile
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