space_agent has asked for the wisdom of the Perl Monks concerning the following question:
Hello fellow seekers of perl wisdom,
To me the following awk code is a piece of art. I got it from
http://www.unix.com/shell-programming-scripting/130349-fgrep-grep-awk-help-scanning-delimiters.html
I wonder if it is possible to make an equally easy to understand and fast perl oneliner:
cat file1 name1 name2 name3 cat file2 >name3 text text text text >name1 some kind of text cat output >name1 text text text text >name3 some kind of text
The task is to extract the names that are present in file1 from file2 plus all the text that follows it until the next ">" character. Speed is of importance as files may well be several hundred MB big. I would be eager to hear any comments on this.
cheers space_agent
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: awk 2 perl oneliner
by almut (Canon) on Mar 05, 2010 at 22:15 UTC | |
by Anonymous Monk on Mar 06, 2010 at 18:14 UTC | |
by almut (Canon) on Mar 06, 2010 at 20:16 UTC | |
by space_agent (Acolyte) on Mar 07, 2010 at 12:57 UTC | |
|
Re: awk 2 perl oneliner
by Marshall (Canon) on Mar 06, 2010 at 09:36 UTC | |
by zwon (Abbot) on Mar 06, 2010 at 10:53 UTC | |
by space_agent (Acolyte) on Mar 06, 2010 at 11:18 UTC |