The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
Perl how to move pointer to previous line in a txt file?
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
Perl how to move pointer to previous line in a txt file?
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
2
(
permalink
)
01-24-2008
Smiling Dragon
Disorganised User
Join Date: Nov 2007
Location: New Zealand
Posts: 922
Try something like this:
Code:
#!/46020/local/bin/
perl
-w $/="\n\n"; while (<STDIN>) { if (/$ARGV[0]/) { print $_ }}
./scriptname.pl SEARCH_STR < /mypath/inputFILE.txt
Smiling Dragon
View Public Profile
Find all posts by Smiling Dragon
Find Smiling Dragon's past nominations received
Find Smiling Dragon's present nominations given