![]() |
|
|
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 |
| concatenate files sorted by date | docaia | Shell Programming and Scripting | 2 | 08-16-2008 03:23 AM |
| Compare 2 sorted files | varungupta | Shell Programming and Scripting | 7 | 01-25-2008 01:07 PM |
| Order files by create date | mab_arif16 | Shell Programming and Scripting | 4 | 05-15-2006 02:04 PM |
| list of files in date order | Jeannine | UNIX for Dummies Questions & Answers | 2 | 08-15-2005 03:19 PM |
| lp - order of files printed | mabrownawa | UNIX for Advanced & Expert Users | 2 | 02-16-2004 12:08 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Say i have 2 files in the giving format:
file1 1 2 3 4 1 2 3 4 1 2 3 4 file2 1 2 3 4 1 2 3 4 1 2 3 4 I have a PERL code (loaned by one of u -i forgot who - thanks!) that extracts the 2nd column from each file and append horizontally to a new file: perl -ane 'push @{$L->[$.]}, $F[1]; close ARGV if eof; END { shift @{$L}; for $l (@{$L}) { print join (" ", @{$l}), "\n"; }}' * >> out.txt Which does the job for over 900 files --but I think it's doing it randomly. The files have an alphanumerical name that follows a chronoloigcal order --and that's the order I would like them to be appended in. How edit the script so that the job is executed as such. desire final result: (disregard the spacing) file1 file2 2 2 2 2 2 2 thanks in advance --!!!! |
| Bookmarks |
| Tags |
| perl, perl shift, shift, shift perl |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|