1

Convert CSV to Fixed Block and Add missing columns at the end

view story
linux-howto

http://www.unix.com – Hi. We are preparing to reprocess our data So we exported the old data into a csv file but in order to reprocess it, it has to be converted to a fixed block file which the current process understands. In addition to this I need to add 5 new columns that where not in the file previously Here is the raw data 1,2,3,4,5 And I was able to reformat it to FB by using the following code: cat test.dat| awk 'BEGIN { FS = "," }; {printf ("%-3s%-23s%-3s%-35s%+05d\n",$1,$2,$3,$4,$5)}' > ref.test.dat But since I need two add 5 spaces and a decimal in the format of +0000 that is (HowTos)