in reply to Re: A string that begins with $ (again)
in thread A string that begins with $ (again)

OK , better this way ?
I think i can sort the wanted lines from the not-wanted ,but the only thing i can use is the first 6 caracters and all lines begins with:
$GPGLL, $GPRMC ,$GPBOD etc.... ( the rest of the characters are newer the same)


But when i try to store a single line the first 6 characters is striped off, and the rest of the line canīt be used for sorting them out.
Sorry for being such a *lamer* ;) , / Johan
  • Comment on Re: Re: A string that begins with $ (again)

Replies are listed 'Best First'.
Re: Re: Re: A string that begins with $ (again)
by rchiav (Deacon) on Apr 25, 2001 at 04:55 UTC
    They aren't being stripped off. use this.. to test
    #!/usr/bin/perl -w #no need here, but you should put this in all your scripts. use strict; while (<>) { print "$_\n"; }
    Now run that and you'll see that all the data is intact.

    Rich

      Thanks, NOw i just have to figure out how to test every line and store the right one in a var.
      I canīt do a:
      !#/user/bin/perl -w use strict; while (<>) { $var = substr($_, 3, 2); print "$var"; }
      but im closer now, thanx again
        You're going to want to use a regular expression. Look at perlre to get started.
        Rich