in reply to Load file from offset file
Here is my interpretation of what you seem to be requesting:
You seem to be on Windows. Use Double-quotes instead of single. You may also need to escape the pipe characters differently.perl -ne 'm/($find)/ and $x{$1}++}{print qq|FIND=$find;\n|;print qq|$ +_\t$x{$_}\n| for sort keys %x' -s -- -find=var1\|var2\|var3 YourFileN +ame.txt
The code above will count the number of times 'var1','var2' and 'var3' occurs in YourFileName.txt.
Syntactic sugar causes cancer of the semicolon. --Alan Perlis
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Load file from offset file
by gio001 (Acolyte) on Mar 29, 2011 at 12:46 UTC |