I have 2 files

File 1:

01:12:00,001 Some text

01:14:00,003 Some text

02:12:01,394 Some text

File 2:

01:12:00,001 Some text

01:12:01,029 Some text

01:13:21,123 Some text

I need output as follows:

01:12:00,001 Some text

01:12:00,001 Some text

01:12:01,029 Some text

01:13:21,123 Some text

01:14:00,003 Some text

02:12:01,394 Some text    

How can I achieve this?

share|improve this question
up vote 4 down vote accepted

Because you're asking for the file to be sorted by the order that the fields appear in the file, this is the most basic use of sort:

sort file1 file2 > outputfile
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.