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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

paste files in one

Status
Not open for further replies.

tonivm

Technical User
Mar 2, 2006
64
ES
Hi everybody:

Could anybody tell me how if I have several files ( each file it has one column) which each one it has this pattern name:

Code:
name1.dat  name2.dat name3.dat name4.dat name10.dat name11.dat name30.dat

If I would like create one like:

Code:
name_total.dat
in order

I have done this two options:
Code:
for i in dn_rad_flux*.dat
	do
		cat $i >> dn_rd.dat
	done
and

Code:
for i in dn_rad_flux*.dat
	do
		paste $i >> dn_rd.dat
	done

Because I would like that each file be pasted in columns. And in two cases I have a paste in one column.

Thanks in advance
 
Why not simply this ?
paste dn_rad_flux*.dat > dn_rd.dat

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks for your reply. But I tried to do like you said, but paste do not "paste" the file in order.
And I would like that when paste it do it like this:

paste file1 file2 file3 file10 file14 .... so on.

:D
 
Well either rename the files
file01
file02
file03
...
or
file001
file002
file003
...


or else

paste file? file?? file??? >file-all


HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top