I think Stefan provided an Elegant query - since he
had a good sample of data, and a specific test case
of code for use to look at.....
>> while ($line = <FILEONE>) {
>> ($nodeid, $nameid, $type, $longitude, $latitude, $altitude) = split
>> ("|", $line);
that regular expression interpolates to
/''|''/
which if you had done by hand with say
split(/''|''/, $line); # with -w and strict
would have noted the use of unitialized value in concatination....
the '|' also gets to the same logical space,
hence what you have is a
split('',$line)
and you wind up catching the fourth and fifth characters in
the line....
>> print FILETWO "P|",$longitude, "|",$latitude,"||";
>> }
>
> I presume you wanted output like:
>
> P|7684940|47534900||
> P|7684940|47534900||
> P|7684940|47534900||
> P|7684940|47534900||
> P|7684940|47534900||
> P|7684940|47534900||
> P|7684940|47534900||
> P|7684940|47534900||
> P|7684940|47534900||
> P|7684940|47534900||
>
> hence wanted to be reminded of { drieux Gets Orthodox }
>
> a) use -w and strict
> b) "|" is a reserved token
> c) "foo" - allows for interpolation of foo between the quotes
>
> hence
> split(/\|/, $line); # my prefered
> or
> split('\|', $line);
>
> depending upon your orthodoxy....
>
>
> while (my $line = <FILEONE>) {
> my ($nodeid, $nameid, $type, $longitude, $latitude, $altitude) = split
> ("|", $line);
> print FILETWO "P|",$longitude, "|",$latitude,"||";
> }
ciao
drieux
---
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]