04-17-2008
Still not seeing it
Humm Still dont know why I dont see this ..
Source file
----------
car
boat
house
Result file
---------
house
camper
car
motorcycle
car
skateboard
car
airplane
boat
house
boat
blimp
house
train
Result of script
---------------
house 3
car 3
boat 2
So ..
open (FILE1, "SOURCEFILE.TXT") or die; #open the source file
open (FILE2, "RESULTFILE.TXT") or die; #open the results file
#
@RESULTARRAY = <FILE2>; #put result file content in an
#array
#foreach $lineinthesourcefile (<FILE1>) { #Step through the source file.
#/$linethesourcefile/g) {
# $count++; # count the number of lineinthesourcefile in
@RESULTARRARY, then print line and count.
}
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
I need an equivalent command in PERL for the following.
export LC_ALL=C;
I hope this is the command. Please confirm this and correct me if i am wrong
$ENV{LC_ALL}="C";
Thanks and Regards
Ammu (1 Reply)
Discussion started by: ammu
1 Replies
2. Shell Programming and Scripting
Hi All,
Is their any equivalent for strtok (in c) to use in perl script.
Thanks in advance.
JS (1 Reply)
Discussion started by: jisha
1 Replies
3. Shell Programming and Scripting
Dear All,
Good day, can any of you help me in the following problem:
I need to find the perl equivalent for the following commandline
grep characters |awk '{print \$2}'Expecting your reply and thanks in advance.
Warm regards
Fredrick. (4 Replies)
Discussion started by: Fredrick
4 Replies
4. Shell Programming and Scripting
I have to do grep -v in a perl script. I want to exclude blank lines and lines having visitor.
#grep -v visitor abc.txt |grep '.'
file:abc.txt
1340 not booked 16D:D9 tourist 8
1341 not booked 16C:D4 tourist 25
1342 not booked 16D:C4 visitor 7
1343 not booked 01C:D9 visitor 6
1344... (4 Replies)
Discussion started by: dynamax
4 Replies
5. Shell Programming and Scripting
What is GAWK equivalent to greps -B 5 -A 5?
zgrep -i "^oct 20" /var/log/syslog*|grep -iB 5 -A 5 'postfix\/pickup
/var/log/syslog.1.gz:Oct 20 01:55:01 elmo CROND: (mail) CMD (/usr/bin/python -S /usr/lib64/mailman/cron/gate_news)
/var/log/syslog.1.gz:Oct 20 02:00:01 elmo CROND: (mail) CMD... (5 Replies)
Discussion started by: metallica1973
5 Replies
6. Shell Programming and Scripting
Hello,
I searched online; it seems that perl use $NR as NR in awk; however it does not work for me. For example, how to re-write the following awk using perl:
awk '{ print NR}' inputfile---------- Post updated at 01:55 PM ---------- Previous update was at 12:49 PM ----------
I found... (2 Replies)
Discussion started by: littlewenwen
2 Replies
7. Shell Programming and Scripting
hi Geeks,
my input file contains data like =>
53 - Deewana Kar Raha Hai.mp3
54 - Hale Dil.mp3
55 - Ishq Sufiyana.mp3
56 - Abhi Kuch Dino Se.mp3
57 - Pee Loon Hoto Ki Sargam.mp3
I had used sed command to remove the prefix from the file name like
sed 's/^\
it gives me the perfect... (4 Replies)
Discussion started by: lohith.dutta
4 Replies
8. Shell Programming and Scripting
Any equivalent command using awk or grep?
sed -n "/^$(date --date='10 minutes ago' '+%b %_d %H:%M')/,\$p" /abc.log (7 Replies)
Discussion started by: timmywong
7 Replies
9. Shell Programming and Scripting
Ive been trying to move to Perl. It has been a struggle.
My question is, is there a good resource that explains nesting statements.
As an example.
To change
primary
Factory CTS 1.9.0(46) P1
*Slot 1 CTS 1.10.2(42) P1
To
primary *Slot 1 CTS 1.10.2(42) P1
... (5 Replies)
Discussion started by: popeye
5 Replies
10. AIX
Need grep -v "Hello" equivalent for AIX (9 Replies)
Discussion started by: mohtashims
9 Replies
LEARN ABOUT NETBSD
zfgrep
ZGREP(1) BSD General Commands Manual ZGREP(1)
NAME
zgrep, zegrep, zfgrep -- print lines matching a pattern in gzip-compressed files
SYNOPSIS
zgrep [grep-flags] [--] pattern [files ...]
zegrep [grep-flags] [--] pattern [file ...]
zfgrep [grep-flags] [--] pattern [file ...]
DESCRIPTION
zgrep runs grep(1) on files or stdin, if no files argument is given, after decompressing them with zcat(1).
The grep-flags and pattern arguments are passed on to grep(1). If an -e flag is found in the grep-flags, zgrep will not look for a pattern
argument.
zegrep calls egrep(1), while zfgrep calls fgrep(1).
EXIT STATUS
In case of missing arguments or missing pattern, 1 will be returned, otherwise 0.
SEE ALSO
egrep(1), fgrep(1), grep(1), gzip(1), zcat(1)
AUTHORS
Thomas Klausner <wiz@NetBSD.org>
BSD
December 28, 2003 BSD