in reply to Re: compare and merge files
in thread compare and merge files
The line still gets a little long when all those file names need to be filled in too. (Why didn't you use "*.part-*" for that?)perl -e 'for(@ARGV){ open(I,"<$_"); s/\.[^\.]*\-[^\-]*$/.MERGED.txt/; open(O,">>$_");print O $_ while <I>;close(O); close(I) }' file.abc.part-1.txt file.abc.part-2.txt file.abc.part-3.txt file.de +f.part-1.txt file.def.part-2.txt
My point is, I've been seeing a lot of this one-liner stuff being offered recently, to people who probably can only scratch their heads and say "That should have been posted in the Obfu wing...".
You'd get more appreciation (and more people would actually be more likely to learn your nifty tricks) if you made it at least a little more legible.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: compare and merge files
by Adrade (Pilgrim) on Feb 06, 2006 at 12:05 UTC |