I have a lot of files with same number of rows and columns.$2 and $3 are the same in all files .
I need to merge $2,$3,$6 from first file and $6 from another files.
Hi
Thanks for your response.
I have 144 files. Is it needed to put all files one by one in the script? (File1 file2...). How can be used loop for this script?
And also it is important assign name of each file to related column. Thanks
---------- Post updated at 12:48 PM ---------- Previous update was at 12:46 PM ----------
Hi
Thanks for your response.
I have 144 files. Is it needed to put all files one by one in the script? (File1 file2...). How can be used loop for this script?
And also it is important assign name of each file to related column. Thanks
Hello sir
Is it possible to run the script with sample files which I attached on the above message.
There are some extra columns and the rows disarranged.
Regards.
Do all of your input files have all of the same values in columns 2 and 3 and do they all have those values in the same order? (If not, how should the output denote no data for a given $2,$3 pair for a given input file?)
Do all 144 files have a common naming scheme? (Are the names really File1 through File144? If so, is it important for the output columns to have the files listed in numeric sort order rather than alphanumeric sort order?)
Your input files seem to have tab separated fields (except the header line), should the output be tab separated or use sequences of spaces for separators? Is it important for the output columns to be aligned and adjust to the maximum input field width for each column (including filenames in the headers)? Why do some of the header fields have $6 filename (with a space) and some have $6filename (without a space)? How is your script supposed to know which output field headers are supposed to have a space?
Are there other files in the directory where you are going to run this script other than the 144 input files you're trying merge? (I assume there are and that is why you're seeing extra columns.) Show us the output you're getting from SriniShoo's script and RavinderSingh13's script for your three sample files. What "extra columns" are you getting?