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

The main problem is now not printing out a string, but getting a part of a string. And note that you've started a *new* thread, rather than continuing the old thread (it's really the same problem, and somebody coming into the conversation late isn't going to easily be able to figure out what the heck you're talking about.

Without any specifics, the only thing I can tell you is that you need to figure out the *pattern* of the strings you have and what marks off the data you want from the data you don't want in those strings. The tool for this is a regular expression; perldoc perlre on your system documents how to use these, but for a gentler introduction, you might peruse the Tutorials section of this site, especially those parts of it that pertain to regular expressions.

HTH

Replies are listed 'Best First'.
Re: Re: A string that begins with $ (again)
by johan_paz (Initiate) on Apr 25, 2001 at 04:36 UTC
    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
      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