0
I have the following files:
-rw-r--r-- 1 xyz xyz 122 May 01 01:00 Test1
-rw-r--r-- 1 xyz xyz 122 May 01 01:00 Test2
-rw-r--r-- 1 xyz xyz 122 May 05 05:00 Test3
-rw-r--r-- 1 xyz xyz 122 May 05 05:00 Test4
The contents of the files contains a description row, followed by data, separated by commas. E.g.:
Test1:
ID, Name, Job, Address
1111, John, Janitor, 1234 Corson Ave
Test2:
ID, Name, Job, Address
2222, Tim, Cashier, 3245 Elliot St
Can someone please suggest a command that would concatenate the files above based on modified date while ignoring the first line in the file, which is the description (ID, Name, Job, Address).
E.g. This is what I would like after the script:
May_1_file_after_concatenate:
1111, John, Janitor, 1234 Corson Ave
2222, Tim, Cashier, 3245 Elliot St
Same thing for May5_file_after_concatenate
. The directory I have will contain many millions of files. I will need for it to automatically sort out base on modified date and concatenate them accordingly.
I am on Centos 7.
By "merge", do you mean "concatenate", or is it possible to have two lines coming from different files with the same ID that would need a special treatment? – choroba – 2016-09-20T16:16:20.143
yes. I meant concatenate. There does not need to be special treatment of same ID's as that is fine if there is more than one. Thanks! – user3567212 – 2016-09-20T16:21:00.493