> "Drieux" == Drieux <[EMAIL PROTECTED]> writes:
Drieux> I just do NOT know right off the top of my head, when,
Drieux> where or HOW I would use that type of a conditional in a split...
@lines = split /\^M\^J|\^J|\^M/, $text_with_unknown_line_endings;
--
Randal L. Schwartz - Stonehenge Co
On Friday, May 10, 2002, at 03:29 , Jeff 'japhy' Pinyan wrote:
[..]
> I'm not necessarily speaking to you -- I'm reminding anyone reading these
> messages that at no point do single quotes stop a regex from being a
> regex.
>
> [snip credentials]
>
>> I know what INTERPOLATION is, and the differ
On May 10, Jonathan E. Paton said:
>> >and hence the magic of using single quotes doesn't work as you'd expect.
>> >It does get you out of other trouble though:
>> >
>> >s'$%@|'replacement';
>> >
>> >where you'd otherwise spend all day backslashing things.
>>
>> All single quotes do is stop INTE
> >and hence the magic of using single quotes doesn't work as you'd expect.
> >It does get you out of other trouble though:
> >
> >s'$%@|'replacement';
> >
> >where you'd otherwise spend all day backslashing things.
>
> All single quotes do is stop INTERPOLATION. Interpolation is not the
> issue
On Fri, 2002-05-10 at 16:54, drieux wrote:
>
> On Friday, May 10, 2002, at 01:20 , Jeff 'japhy' Pinyan wrote:
>
> > On May 10, Jonathan E. Paton said:
> >
> >> Opps! NB: Also lost the lc() from this too :P
> >
> > Gah! ;)
>
> isn't there a requirement that you are
> not allowed to swear in Kli
On Friday, May 10, 2002, at 01:20 , Jeff 'japhy' Pinyan wrote:
> On May 10, Jonathan E. Paton said:
>
>> Opps! NB: Also lost the lc() from this too :P
>
> Gah! ;)
isn't there a requirement that you are
not allowed to swear in Klingon on a public
email list
myJackBootedFascistHouseMate alw
On May 10, Jonathan E. Paton said:
>and hence the magic of using single quotes doesn't work as you'd expect.
>It does get you out of other trouble though:
>
>s'$%@|'replacement';
>
>where you'd otherwise spend all day backslashing things.
All single quotes do is stop INTERPOLATION. Interpolatio
> > Oh yeah makes perfect sense now...match nothing or nothing and sense
> > everything has nothing it always matches. haha...I like that.
> >
> > Tanton
>
> I guess the two HORRORS I would like to stomp on are
>
> a) using "|" as a delimiter
Everyone should be using the standard CSV nota
On May 10, Jonathan E. Paton said:
>Opps! NB: Also lost the lc() from this too :P
Gah! ;)
>perl -ne '!$seen{lc~~(split/\|/)[3]}++&&print' input > output
s/~~/+/;
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmonks.
On Friday, May 10, 2002, at 12:41 , Tanton Gibbs wrote:
> Oh yeah makes perfect sense now...match nothing or nothing and sense
> everything has nothing it always matches. haha...I like that.
>
> Tanton
I guess the two HORRORS I would like to stomp on are
a) using "|" as a delimiter
> > Looks like that question has been quite well covered.
> > Under Unix, my simple version can be reduced to:
> >
> >cat list.current | perl -ne 'print if not $seen{split'|'}++' > list.new
>
> Not so.
Had you fooled for a moment!
> First, you've got quote problems.
Doh! I'd prefer to change
On May 10, Jonathan E. Paton said:
>> I meant to convert the email address to lowercase...
>
>Wonder where you got that idea? ;-)
Oh, hush. ;) We all had the same answers, more or less.
>Looks like that question has been quite well covered. Under Unix, my simple
>version can be reduced to:
>
> >>I am using it as a mailing list. However, over the last half year, it has
> >>gotten pretty big, and has some duplicates in it. For reporting sake, I
> >>would like to delete the duplicate records based on email addresses. If you
> >>sign up three times, I only want to keep your first recor
Oh yeah makes perfect sense now...match nothing or nothing and sense
everything has nothing it always matches. haha...I like that.
Tanton
- Original Message -
From: "Jonathan E. Paton" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 10, 2002 3:41 PM
> I ran some tests and it looks like /|/ matches just about anything...what
> does /|/ mean?
If it were a regex, hang on... maybe it is... it would mean:
Match a zero length string OR a zero length string. | is the regex character
for OR.
Jonathan Paton
___
lt;[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, May 10, 2002 3:36 PM
Subject: Re: Text file manipulation
> On May 10, Tanton Gibbs said:
>
> >while( ) { # loop through the file, store current rec in $_
> > my @record = split(/|/,$_); # record[0] = lastnam
On May 10, Jeff 'japhy' Pinyan said:
>On May 10, Hughes, Andrew said:
>
>>I am using it as a mailing list. However, over the last half year, it has
>>gotten pretty big, and has some duplicates in it. For reporting sake, I
>>would like to delete the duplicate records based on email addresses. I
On May 10, Tanton Gibbs said:
>while( ) { # loop through the file, store current rec in $_
> my @record = split(/|/,$_); # record[0] = lastname
You need to split on /\|/, not /|/.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia brother #734 http:/
On May 10, Hughes, Andrew said:
>I am using it as a mailing list. However, over the last half year, it has
>gotten pretty big, and has some duplicates in it. For reporting sake, I
>would like to delete the duplicate records based on email addresses. If you
>sign up three times, I only want to
]
Subject:Re: Text file manipulation
Probably something like this:
open FILE, "input.txt" or die "Could not open input.txt:
$!\n"; # open the
input file containing the records
open OUTFILE, ">o
> I want this file:
>
> jones|Bob|Acme1|[EMAIL PROTECTED]|GA|2/25/2002
> jones|Bob|Acme1|[EMAIL PROTECTED]|GA|2/28/2002
> smith|Jan|Acme2|[EMAIL PROTECTED]|FL|3/1/2002
> johnson|Salley|Acmeshop|[EMAIL PROTECTED]|TN|4/5/2002
>
> SMITH|JAN|ACME2|[EMAIL PROTECTED]|FL|5/2/2002
>
> to change to this
Probably something like this:
open FILE, "input.txt" or die "Could not open input.txt: $!\n"; # open the
input file containing the records
open OUTFILE, ">output.txt" or die "Could not open output.txt: $!\n";
#output the output file for unique recs
my %addys; # a hash to store the unique recs i
22 matches
Mail list logo