Convert columns of data into rows
I have the following CSV file (file name system1.csv);
Now, I need to create an out put file, last two columns as a row of data (using the first columns as heading) with the file name as first row. For an example the out put file should look like;
I need to run a script to do above conversion. Need your help.
Use "cut -c<column-beging>-<column-end> <input-file>" for extracting from columns from a file.
for example, in your case "cut -c1-4 input_file" for extracting first 4 chars from each line.
Also if you have a known delimiter for the to-be-extracted column, you can use "cut -d" along with delimiter.
There can be a million other ways to do the same. these are the easiest IMHO.
Hope this helps
My royalty fee is only 3 cents per script execution or 1 cent per file processed -- which ever is more expensive. ;)
|All times are GMT -5. The time now is 03:22 AM.|