I'm trying to write a unix script to handle this function
we are in the ksh env, but force bash in scripting
I have three files as input and need to concatenate them onto one line at a time
For example: The first record of each file is
File 1 =a
File 2 =b
File 3 =c
Output should be a;b;c
Second line of each file is
File 1 =d
File 2 =e
File 3 =f
output should be d;e;f
I would like to eventually open this file in excel. That is why I added the delimiters.
I think I've misrepresented my input files. I have three files with data in them. I want to string the data in those files together on one line, so I tried a cat statement, but it just lists all the files end to end. I need unix to read one record from each file and string them together on one line with delimeters, then go to the next line on each input file and create a new line on the output file with second record. Each file has approx 10,000 lines on it. All the reconstructed records need to be on one output file in a csv format
sorry for the confusion or maybe I'm just confused on what you guys are showing me
I just replaced your file names with my actual names and got some errors.
awk '{getline a < "scomp2p8_2010_03_01.txt";getline b < "scomp2p6_2010_03_01.txt";print $0,a,b}' OFS=";" scomp2p5_2010_03_01.txt > scomp2p9_2010_03_01.txt''
awk: syntax error near line 1
awk: illegal statement near line 1
awk: syntax error near line 1
awk: illegal statement near line 1
---------- Post updated at 03:36 PM ---------- Previous update was at 03:34 PM ----------
[/COLOR]that double quote at the end isn't actually part of the awk statement