![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to merge different coulmn of differnt files | rahul sharma11 | Shell Programming and Scripting | 10 | 05-09-2008 04:55 AM |
| processing matrix column wise | Abhishek Ghose | Shell Programming and Scripting | 5 | 08-21-2007 01:55 PM |
| Unix addition ( Row wise) | gauravgoel | Shell Programming and Scripting | 3 | 05-17-2007 05:27 AM |
| Manipulating fields record wise | rinku11 | Shell Programming and Scripting | 1 | 12-07-2005 10:42 AM |
| System RAM identification slot-wise | diliphere | UNIX for Advanced & Expert Users | 0 | 08-23-2005 09:45 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Paste coulmn wise
Hello,
I need few clarification in types of paste command ussage in coulmn mode : In a directory i have few file distinguished as *.cpu *.vmem and *.mem and have coulmn entries like first cpu file 89576 89576 89576 89576 89576 89576 89576 second cpu file 46312 46312 46312 46312 46312 46312 46312 46312 46312 and third cpu file 46392 46392 46392 46392 46392 46392 and i want my output as first file,second file, third file 89576,46312,46392 89576,46312,46392 89576,46312,46392 89576,46312,46392 89576,46312,46392 89576,46312,46392 i can do it easily by paste command paste -d"," first cpu file second cpu file third cpu file > output but i dont know how many number of files there are for cpu extn.... i wrote a script : ls -ltr |tr -s " " ";" |cut -d";" -f9 |egrep "(.cpu$|.vmem$|.mem$)" > temp1 cut -d"." -f1,2 temp1 |sort -u |> temp2 for var in `cat temp2` do paste -d"," $var" >> out done But it will paste the file i same coulmn: Pls suggest possible one line command for it .I think using nawk or sed i can do it but i amd not having good Knowledge of them ... thanks in advance Aparna |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|