User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 402,514 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,719 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser: Programming Forums
Views: 729 | Replies: 1
Reply
Join Date: Aug 2006
Posts: 1
Reputation: #ToNeT# is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
#ToNeT#'s Avatar
#ToNeT# #ToNeT# is offline Offline
Newbie Poster

Paste files in order and columns

  #1  
Oct 19th, 2007
Hi everybody:

I have a problem , I would like to paste different files which has this pattern name:

namefile_number.dat

like this:

namefile_1.dat namefile_2.dat ....

And I have tried to use paste command, for create a name_final.dat. But such I have done:

paste namefile_*.dat > name_final.dat 

It works but I would like that paste command do it in order . Then I have done:

for i in namefile*.dat
do
    paste $i >> namefinal.dat
done

And paste it but all in one column, like this:

namefile_1.dat
namefile_2.dat
namefile_3.dat
.....
namefile_number.dat

My question is. Is there any solution for from different files where each file is named like namefile_number.dat paste all in one but each time that paste act it do it in columns. Like this:

 namefile_1.dat namefile_2.dat ...... namefile_number.dat
.

Oh I forget it, there are some numbers that do not exist.

Thanks in advance
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2007
Posts: 6
Reputation: n2201 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
n2201 n2201 is offline Offline
Newbie Poster

Re: Paste files in order and columns

  #2  
Oct 25th, 2007
Have you tried ls and then pipe the out put to sed and replace all spaces with single space?
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Shell Scripting Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Shell Scripting Forum

All times are GMT -4. The time now is 6:19 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC