Transpose only few columns to rows in csv
I have a csv file in this format:
Quote:
Quote:
|
With this InFile ...
Code:
file brands kpi country jan01 feb01 Code:
paste -sd" \n" $InFile \ Code:
file brands kpi country monyy values |
Thanks Martin. I have recently started learning awk.Could you please provide pointers on how to become an expert in awk :)
|
Quote:
Daniel B. Martin |
Could you please tell how to process this script on the csv file?
|
Continuing on the path of incremental improvement, this is a way to eliminate the paste used in post #2.
With this InFile ... Code:
file brands kpi country jan01 feb01 Code:
awk '{mmmdd[1]=$5; mmmdd[2]=$6; Code:
file brands kpi country monyy values |
Quote:
Daniel B. Martin |
I am trying to execute the code in this fashion.
awk -f transpose.sh Book1.csv Book2.csv Is this the correct way? transpose.sh is the script file and Book1 is the i/p file and book2 is the o/p file Seems i am lost and unable to execute the code |
Here is the link to the csv file which I want to work on
https://drive.google.com/file/d/0BwI...ew?usp=sharing |
Quote:
2) csv stands for comma separated values file. Ordinarily it takes the form of a text file containing information separated by commas, hence the name. The sample input file you provided has no commas. Therefore it is not a csv file (to my understanding.) This is my program in its entirety. Code:
#!/bin/bash Daniel B. Martin Jun15 |
Hi martin,
I am unable to achieve the desired result. Quote:
|
Quote:
The Wanted file contains ... Code:
file brands kpi country monyy values Daniel B. Martin |
Quote:
Daniel B. Martin |
The code is producing an outfile.txt but not the wanted.txt file
|
Quote:
As this forum exchange develops I get the feeling that we are not communicating well. This may be my fault for not understanding your problem. If I have led you down a wrong path, I apologize. Daniel B. Martin |
All times are GMT -5. The time now is 07:07 AM. |