develooper Front page | perl.beginners | Postings from February 2009

Re: Add Line break when first of a line changes

Thread Previous | Thread Next
February 15, 2009 07:13
Re: Add Line break when first of a line changes
Message ID:
On Sun Feb 15 2009 @  8:56, Jack Butchie wrote:
> I did some fiddling with the list.  I noticed if the second or third or  
> whatever column wasn't exactly the same as the previous, even though the 
> tex in the first field was the same,  line was being added. I then tested 
> with only the first field in the list and it worked perfectly. The script 
> seems not to like anything different in other columns/fields.

Right, as I said (and Gunnar made clearer), this is *not* testing product
names for equality. It's testing the entire lines for equality.

Which field do you actually want to test? Now that I look at your initial
email, I'm guessing that what you actually want to test is "LAWN SEED"
against "LAWN SEED1" - which makes things a bit more complicated. Your file
doesn't have a consistent field separator (sometimes a space is part of a
product name, sometimes not). A solution that works for "LAWN SEED" and
"LAWN SEED1" won't be identical to one for "LAWN SEED1" compared to

So, what does the file really look like?

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About