Saravana Kumar wrote:
yitzle wrote:
You can read one list into an array (@list) and then loop through the
other file ($item) and grep the list for the item.
for ($item = ) { # or foreach
print $item found if ( grep $item, @list );
}
On 4/20/07, Saravana Kumar [EMAIL PROTECTED
Hi list,
I am testing a regex with email ids. I have a list of ids that i want to
match against a one more list of ids.
I have this:
#! /usr/bin/perl
$id=[EMAIL PROTECTED];
while() {
chomp($_);print $_\t;
print $id found\n if /$id/;
print $id not found\n if ! /$id/;
}
and a file /tmp/sampleids
is that the $id that i am
matching will also be read from another file.
ie., a list of ids read one by one from a file and matched against another
file which has another list.
Thanks! for your time.
SK
Saravana Kumar wrote:
Hi list,
I am testing a regex with email ids. I have a list of ids
yitzle wrote:
You can read one list into an array (@list) and then loop through the
other file ($item) and grep the list for the item.
for ($item = ) { # or foreach
print $item found if ( grep $item, @list );
}
On 4/20/07, Saravana Kumar [EMAIL PROTECTED] wrote:
Boga Srinivas wrote
Hi list,
I am trying to remove the extension from the a list of filenames and
manipulate the names further.
Tried to doing this:
$file=~ s/\..*//;
The above works fine. I get the result 'filename' if the filename is
filename.ext.
There are some files whose names are like file.name.ext and
shaick mohamed wrote:
Try this
s/(.*)\..*/\1/;
Thanks,
Shaick.
On 1/23/07, Saravana Kumar [EMAIL PROTECTED] wrote:
Hi list,
I am trying to remove the extension from the a list of filenames and
manipulate the names further.
Tried to doing this:
$file=~ s/\..*//;
The above works
Rob Dixon wrote:
Saravana Kumar wrote:
John W. Krahn wrote:
Saravana Kumar wrote:
I am new to the list and newbie in perl.
I have a big flat file(100G). The file was supposed to be in a single
line but many of records(as it has ^M). There are also ^@ and tabs in
between
John W. Krahn wrote:
Saravana Kumar wrote:
Hi,
Hello,
I am new to the list and newbie in perl.
I have a big flat file(100G). The file was supposed to be in a single
line but many of records(as it has ^M). There are also ^@ and tabs in
between.
I want to first replace the control
Hi,
I am new to the list and newbie in perl.
I have a big flat file(100G). The file was supposed to be in a single line
but many of records(as it has ^M). There are also ^@ and tabs in between.
I want to first replace the control characters and tabs with space.
I tried this s/[[:cntrl:]\t]/