in reply to Re^2: reading N files
in thread reading N files
The unix "paste" command takes a list of file names and concatenates them "horizontally", line by line; for a list of input files (1..N), its default behavior replaces the newline with a tab for each line of files 1..N-1.# assuming N files are named in some systematic way, # and columns are separated by whitespace: paste file.* | perl -pe '($t)=(/^(\S+)/); s/\t$t//g;' > multi-column.f +ile
Assuming that all files in the set have the same series of values in the first column, the perl script removes all but the first occurrence of that value on each line. (If all these assumptions don't apply, then your approach of reading from a set of file handles in a loop is fine, of course.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: reading N files
by gri6507 (Deacon) on Jul 20, 2006 at 12:24 UTC |