Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

join of files 1

Status
Not open for further replies.

Yarka

Technical User
Jan 14, 2007
192
ES
hi,
i've a program that it generates a lot of files whose names are as:
A-21.43.38.txt
A-22.44.11.txt
A-22.08.57.txt
A-23.58.22.txt
A-00.33.16.txt
A-01.38.32.txt
....

The name's number is the time that the program has generated this files. I need to join it into order before in one only file.

How can I do it?
Thanks.
 
Sorry, I don't understand your question.
What is the expected result ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
A-21.43.38.txt
A-22.44.11.txt
A-22.08.57.txt
A-23.58.22.txt
A-00.33.16.txt
A-01.38.32.txt
are files that it contains data (it occupies 200M approximately each one). I need to join the content of these files in only one. The order has to do based on the name of the file, which is indicating the hour in that it has been generated. The order of the union is very important because later I must pass scripts so that it extracts results to me.
Therefore, the result has to be an only file.

Thanks.
 
So, A-00.33.16.txt should be first and A-23.58.22.txt last ?
cat A-??.??.??.txt > newfile.txt

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
No, the order is:
first: A-21.43.38.txt
second: A-22.44.11.txt
...
last: A-01.38.32.txt

it is because it is the next day.
 
Perhaps this ?
cat `ls -tr A-??.??.??.txt` > newfile.txt

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
ls -tr A-??.??.??.txt|xargs cat > newfile.txt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top