Dear Unix experts and users
I have 2 kinds of files like below, of which I need to merge them in the order of time.
File1:
Date_Time Context D1 D2
04/19/2013_23:48:54.819 ABCD x x
04/19/2013_23:48:55.307 ABCD x x
04/19/2013_23:48:55.823 ABCD x x
04/19/2013_23:48:56.309 ABCD x x
Data columns from file1 are indicated with 'x'.
File2:
Date_Time Context D3 D4
04/19/2013_23:48:54.819 ABCD y y
04/19/2013_23:48:55.821 ABCD y y
04/19/2013_23:48:56.799 ABCD y y
04/19/2013_23:48:57.819 ABCD y y
Data columns from file2 are indicated with 'y'.
Here except the first entry from Date_Time column in both files all rest of the time stamp entries are different.
My result (or merged) file should be like below.
Required output
Date_Time Context D1 D2 D3 D4
04/19/2013_23:48:54.819 ABCD x x blank blank
04/19/2013_23:48:54.819 ABCD blank blank y y
04/19/2013_23:48:55.307 ABCD x x blank blank
04/19/2013_23:48:55.821 ABCD blank blank y y
04/19/2013_23:48:55.823 ABCD x x blank blank
04/19/2013_23:48:56.309 ABCD x x blank blank
04/19/2013_23:48:56.799 ABCD blank blank y y
04/19/2013_23:48:57.819 ABCD blank blank y y
So describe the output it is sorted by time stamp but the sorting should preserve the position of other column data cells and we should include blanks where where the other file data doesn't exist. The context data field(s) should be as it is between and print int he output.
By the way my files are of .csv type.
Please revert to me if my problem description is not clear.
Thanks
Sidda