Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

parsing string 2

Status
Not open for further replies.

LAdProg2005

Programmer
Feb 20, 2006
56
US
hi all again,

i am going through file parsing strings...
ie.
Date: 08/01/09 By: LAdProg
Info: This is test
by \lad:prog
20'05

i go by line match the string:
$myLine =~ /Date/

then i use substring funtion to get whatever is after ':'
$date=substr($line,5,8);
and so on...issue could be that length of string after : could be any number long

is there a better way of doing this then going through substring...i can see substring not working for info: as after : there is new lines and text with characters could be any number long.

thanks
 
Hi

I would capture the date instead of extracting it separately :
Perl:
[navy]$date[/navy][teal]=[/teal][navy]$1[/navy] [b]if[/b] [navy]$line[/navy][teal]=~[/teal][green][i]/Date: ([[:digit:]\/]+)/[/i][/green][teal];[/teal]
But I not understood what you actually want. Post your code.

Feherke.
 
extraction is ok...

issue could be that length of string after : could be any number long

is there a better way of doing this then going through substring...i can see substring not working for info: as after : there is new lines and text with characters could be any number long.


open(MYDATA, "test.txt")
$line;
$lnum = 1;
while( $line = <MYDATA> ){
chomp($line);

if($line =~ /DATE/)
{
$offType=substr($line,29,8);
($m, $d, $y) = split("/", $offType);
$y = "20" . $y;
$dateObj = sprintf("%4d-%02d-%02d", $y, $m, $d);
}

#doesn't work
if($line =~ /INFO/)
{
$info=substr($line,6,200);
}
$lnum++;
}
print "$dateObj $info\n";
close MYDATA;
----------Test.txt----------
DATE: 09/03/09 BY: LAdProg

INFO:
THIS IS TEST
BY \LAD:pROG
*A-OK FOR 20'05
 
I would like to do it this way...my only issue is when substring i do not know how to stop at the end of the data.

i.e. how reading anything after "info:" and stop at end of line($) or whitespace or end of the file incase of info:.

thanks,
 
Do you mean something like this?
Code:
[url=http://perldoc.perl.org/functions/use.html][black][b]use[/b][/black][/url] [green]strict[/green][red];[/red]
[black][b]use[/b][/black] [green]warnings[/green][red];[/red]

[url=http://perldoc.perl.org/functions/my.html][black][b]my[/b][/black][/url] [blue]$lines[/blue] = [url=http://perldoc.perl.org/functions/join.html][black][b]join[/b][/black][/url][red]([/red][red]'[/red][purple][/purple][red]'[/red], <DATA>[red])[/red][red];[/red]
[url=http://perldoc.perl.org/functions/print.html][black][b]print[/b][/black][/url] [red]"[/red][purple]The data is:[purple][b]\n[/b][/purple][purple][b]\n[/b][/purple]'[blue]$lines[/blue]'[purple][b]\n[/b][/purple][purple][b]\n[/b][/purple][/purple][red]"[/red][red];[/red]

[olive][b]if[/b][/olive] [red]([/red][blue]$lines[/blue] =~ [red]/[/red][purple]Date: ([purple][b]\d[/b][/purple]{2}[purple][b]\/[/b][/purple][purple][b]\d[/b][/purple]{2}[purple][b]\/[/b][/purple][purple][b]\d[/b][/purple]{2}).+By: ([purple][b]\w[/b][/purple]+).*Info: (.*)[/purple][red]/[/red][red]ms[/red][red])[/red] [red]{[/red]
  [black][b]my[/b][/black] [blue]$date[/blue] =[blue]$1[/blue][red];[/red]
  [black][b]my[/b][/black] [blue]$by[/blue] = [blue]$2[/blue][red];[/red]
  [black][b]my[/b][/black] [blue]$info[/blue] =[blue]$3[/blue][red];[/red]
  [black][b]print[/b][/black] [red]"[/red][purple]Results matched:[purple][b]\n[/b][/purple][purple][b]\n[/b][/purple][/purple][red]"[/red][red];[/red]
  [black][b]print[/b][/black] [red]"[/red][purple]Date = '[blue]$date[/blue]'[purple][b]\n[/b][/purple][/purple][red]"[/red][red];[/red]
  [black][b]print[/b][/black] [red]"[/red][purple]By = '[blue]$by[/blue]'[purple][b]\n[/b][/purple][/purple][red]"[/red][red];[/red]
  [black][b]print[/b][/black] [red]"[/red][purple]Info = '[blue]$info[/blue]'[purple][b]\n[/b][/purple][/purple][red]"[/red][red];[/red]
[red]}[/red]

[gray][i]# your data:[/i][/gray]
[teal]__DATA__[/teal]
[teal] Date: 08/01/09          By: LAdProg[/teal]
[teal] Info: This is test[/teal]
[teal] by \lad:prog[/teal]
[teal] 20'05[/teal]
[tt]------------------------------------------------------------
Pragmas (perl 5.10.0) used :
[ul]
[li]strict - Perl pragma to restrict unsafe constructs[/li]
[li]warnings - Perl pragma to control optional warnings[/li]
[/ul]
[/tt]

Output:
Code:
The data is:

' Date: 08/01/09          By: LAdProg
 Info: This is test
 by \lad:prog
 20'05
'

Results matched:

Date = '08/01/09'
By = 'LAdProg'
Info = 'This is test
 by \lad:prog
 20'05
'
 
Yes that works gr8. Can you please explain the magic ($lines =~ /Date: (\d{2}\/\d{2}\/\d{2}).+By: (\w+).*Info: (.*)/ms) and
my $date =$1;
my $by = $2;
my $info =$3; does?

If i understand correctly it does something like:
look for date:, .-> probably means continue searching for By and so on....now * and (.*) i do not know.

Thanks you very much...

 
/Date: (\d{2}\/\d{2}\/\d{2}).+By: (\w+).*Info: (.*)/ms is a Regular Expression (regex for short). They are used for matching against strings. You can read about them on the man perlre page.

Code:
/          - beginning of the regex
Date:      - literal string match
(          - beginning of a subexpression
\d{2}      - 2 digits
\/         - a literal forward slash (escaped so it does not end the regex)
\d{2}      - 2 digits
\/         - a literal forward slash 
\d{2}      - 2 digits
)          - end of a subexpression
.+         - one or more characters (. is any character, + is one or more of the preceding element)
By:        - literal string match
(\w+)      - one or more word characters (i.e. not white space) in a subexpression
.*         - zero or more characters (* is zero or more of preceding element)
Info:      - literal string match
(.*)       - zero or more characters in a subexpression
/          - end of the regex
ms         - regex options (m = multiple lines, s = single line)

If the regex matches, any subexpressions are assigned to the special variables $1, $2, ... and the entire match is assigned to $&.

I think the 'm' option is unnecessary here as ^ and $ are not used in the regex. Normally it changes their behaviour from matching beginning/end of string to beginning/end of multiple lines within a string. The 's' option allows "." any character matches to span multiple lines (i.e. it matches \n as well when it normally wouldn't).

Annihilannic.
 
I understand. Very helpful.

Just one quickie..

I was doing
if ($lines =~ /Info: (.*)/s) {
my $info =$1;
print "Info = '$info'\n";
}

but it comes back with nothing. i don't know what differed...
 
Also, is there way to put $info in one line instead three separate...CURIOUS...

Thanks again!!!
 
LAdProg2005 said:
is there way to put $info in one line instead three separate
Yes, there is. Eliminate the \n character.
Code:
[url=http://perldoc.perl.org/functions/use.html][black][b]use[/b][/black][/url] [green]strict[/green][red];[/red]
[black][b]use[/b][/black] [green]warnings[/green][red];[/red]

[url=http://perldoc.perl.org/functions/my.html][black][b]my[/b][/black][/url] [blue]$lines[/blue] = [url=http://perldoc.perl.org/functions/join.html][black][b]join[/b][/black][/url][red]([/red][red]'[/red][purple][/purple][red]'[/red], <DATA>[red])[/red][red];[/red]
[url=http://perldoc.perl.org/functions/print.html][black][b]print[/b][/black][/url] [red]"[/red][purple]The data is:[purple][b]\n[/b][/purple][purple][b]\n[/b][/purple]'[blue]$lines[/blue]'[purple][b]\n[/b][/purple][purple][b]\n[/b][/purple][/purple][red]"[/red][red];[/red]

[olive][b]if[/b][/olive] [red]([/red][blue]$lines[/blue] =~ [red]/[/red][purple]Date: ([purple][b]\d[/b][/purple]{2}[purple][b]\/[/b][/purple][purple][b]\d[/b][/purple]{2}[purple][b]\/[/b][/purple][purple][b]\d[/b][/purple]{2}).+By: ([purple][b]\w[/b][/purple]+).*Info: (.*)[/purple][red]/[/red][red]s[/red][red])[/red] [red]{[/red]
  [black][b]my[/b][/black] [blue]$date[/blue] =[blue]$1[/blue][red];[/red]
  [black][b]my[/b][/black] [blue]$by[/blue] = [blue]$2[/blue][red];[/red]
  [black][b]my[/b][/black] [blue]$info[/blue] =[blue]$3[/blue][red];[/red]
  [blue]$info[/blue] =~ [red]s/[/red][purple][purple][b]\n[/b][/purple][/purple][red]/[/red][purple][/purple][red]/[/red][red]g[/red][red];[/red]
  [black][b]print[/b][/black] [red]"[/red][purple]Results matched:[purple][b]\n[/b][/purple][purple][b]\n[/b][/purple][/purple][red]"[/red][red];[/red]
  [black][b]print[/b][/black] [red]"[/red][purple]Date = '[blue]$date[/blue]'[purple][b]\n[/b][/purple][/purple][red]"[/red][red];[/red]
  [black][b]print[/b][/black] [red]"[/red][purple]By = '[blue]$by[/blue]'[purple][b]\n[/b][/purple][/purple][red]"[/red][red];[/red]
  [black][b]print[/b][/black] [red]"[/red][purple]Info = '[blue]$info[/blue]'[purple][b]\n[/b][/purple][/purple][red]"[/red][red];[/red]
[red]}[/red]

[gray][i]# your data:[/i][/gray]
[teal]__DATA__[/teal]
[teal]Date: 08/01/09          By: LAdProg[/teal]
[teal]Info: This is test[/teal]
[teal]by \lad:prog[/teal]
[teal]20'05[/teal]
[tt]------------------------------------------------------------
Pragmas (perl 5.10.0) used :
[ul]
[li]strict - Perl pragma to restrict unsafe constructs[/li]
[li]warnings - Perl pragma to control optional warnings[/li]
[/ul]
[/tt]

Output:
Code:
The data is:

'Date: 08/01/09          By: LAdProg
Info: This is test
by \lad:prog
20'05
'

Results matched:

Date = '08/01/09'
By = 'LAdProg'
[COLOR=red]Info = 'This is testby \lad:prog20'05'[/color]
 
LAdProg2005 said:
Just one quickie..

I was doing
if ($lines =~ /Info: (.*)/s) {
my $info =$1;
print "Info = '$info'\n";
}

but it comes back with nothing. i don't know what differed...

Maybe you forgot something in your source (in previous step), look it works too:

Code:
[url=http://perldoc.perl.org/functions/use.html][black][b]use[/b][/black][/url] [green]strict[/green][red];[/red]
[black][b]use[/b][/black] [green]warnings[/green][red];[/red]

[url=http://perldoc.perl.org/functions/my.html][black][b]my[/b][/black][/url] [blue]$lines[/blue] = [url=http://perldoc.perl.org/functions/join.html][black][b]join[/b][/black][/url][red]([/red][red]'[/red][purple][/purple][red]'[/red], <DATA>[red])[/red][red];[/red]
[url=http://perldoc.perl.org/functions/print.html][black][b]print[/b][/black][/url] [red]"[/red][purple]The data is:[purple][b]\n[/b][/purple][purple][b]\n[/b][/purple]'[blue]$lines[/blue]'[purple][b]\n[/b][/purple][purple][b]\n[/b][/purple][/purple][red]"[/red][red];[/red]

[olive][b]if[/b][/olive] [red]([/red][blue]$lines[/blue] =~ [red]/[/red][purple]Info: (.*)[/purple][red]/[/red][red]s[/red][red])[/red] [red]{[/red]
  [black][b]my[/b][/black] [blue]$info[/blue] =[blue]$1[/blue][red];[/red]
  [blue]$info[/blue] =~ [red]s/[/red][purple][purple][b]\n[/b][/purple][/purple][red]/[/red][purple][/purple][red]/[/red][red]g[/red][red];[/red]
  [black][b]print[/b][/black] [red]"[/red][purple]Info = '[blue]$info[/blue]'[purple][b]\n[/b][/purple][/purple][red]"[/red][red];[/red]
[red]}[/red]


[gray][i]# your data:[/i][/gray]
[teal]__DATA__[/teal]
[teal]Date: 08/01/09          By: LAdProg[/teal]
[teal]Info: This is test[/teal]
[teal]by \lad:prog[/teal]
[teal]20'05[/teal]
[tt]------------------------------------------------------------
Pragmas (perl 5.10.0) used :
[ul]
[li]strict - Perl pragma to restrict unsafe constructs[/li]
[li]warnings - Perl pragma to control optional warnings[/li]
[/ul]
[/tt]
Output:
Code:
The data is:

'Date: 08/01/09          By: LAdProg
Info: This is test
by \lad:prog
20'05
'

Info = 'This is testby \lad:prog20'05'
 
Interesting:

i tried it couple times but nothing.
DOes it make a difference if
--mine has (with set list option)----
INFO:$
THIS IS TEST$
BY \LAD:pROG$
*A-OK FOR 20'05$

instead of
--you are using----
Info: This is test$
by \lad:prog$
20'05$

 
Here is what i have may be it will help explain the mismatch

Code:
#my $lines = join('', <DATA>);
my $lines;
my $lnum = 1;
while( $lines = <DATA> ){
  chomp($lines);

#print "The data is:\n\n'$lines'\n\n";

if($lines=~/INFO:(.*)/s)
{
 my $rem = $1;
 print "$rem\n";
}

$lnum++;
}


# your data:
__DATA__
Date: 08/01/09          By: LAdProg

 INFO:$
        THIS IS TEST$
        BY \LAD:PROG$
        *A-OK FOR 20'05$
 
Hi LAdProg2005,

What you try is pretty different from that what I posted. I modified your source a little bit - so you should see how the program works:
Code:
[url=http://perldoc.perl.org/functions/use.html][black][b]use[/b][/black][/url] [green]strict[/green][red];[/red]
[black][b]use[/b][/black] [green]warnings[/green][red];[/red]

[gray][i]#my $lines = join('', <DATA>);[/i][/gray]
[url=http://perldoc.perl.org/functions/my.html][black][b]my[/b][/black][/url] [blue]$line[/blue][red];[/red]
[black][b]my[/b][/black] [blue]$lnum[/blue] = [fuchsia]1[/fuchsia][red];[/red]
[olive][b]while[/b][/olive][red]([/red] [blue]$line[/blue] = <DATA> [red])[/red][red]{[/red]
  [url=http://perldoc.perl.org/functions/chomp.html][black][b]chomp[/b][/black][/url][red]([/red][blue]$line[/blue][red])[/red][red];[/red]

  [url=http://perldoc.perl.org/functions/print.html][black][b]print[/b][/black][/url] [red]"[/red][purple]The data in [blue]$lnum[/blue].line:[purple][b]\n[/b][/purple]'[blue]$line[/blue]'[purple][b]\n[/b][/purple][/purple][red]"[/red][red];[/red]

  [olive][b]if[/b][/olive][red]([/red][blue]$line[/blue]=~[red]/[/red][purple]INFO:(.*)[/purple][red]/[/red][red]s[/red][red])[/red] [red]{[/red]
    [black][b]my[/b][/black] [blue]$rem[/blue] = [blue]$1[/blue][red];[/red]
    [black][b]print[/b][/black] [red]"[/red][purple]!!! found [purple][b]\$[/b][/purple]rem='[blue]$rem[/blue]' !!![purple][b]\n[/b][/purple][/purple][red]"[/red][red];[/red]
  [red]}[/red]

  [blue]$lnum[/blue]++[red];[/red]
[red]}[/red]


[gray][i]# your data:[/i][/gray]
[teal]__DATA__[/teal]
[teal]Date: 08/01/09          By: LAdProg[/teal]

[teal]INFO:$[/teal]
[teal]        THIS IS TEST$[/teal]
[teal]        BY \LAD:PROG$[/teal]
[teal]        *A-OK FOR 20'05$[/teal]
[tt]------------------------------------------------------------
Pragmas (perl 5.10.0) used :
[ul]
[li]strict - Perl pragma to restrict unsafe constructs[/li]
[li]warnings - Perl pragma to control optional warnings[/li]
[/ul]
[/tt]
Output:
Code:
The data in 1.line:
'Date: 08/01/09          By: LAdProg'
The data in 2.line:
''
The data in 3.line:
'INFO:$'
[COLOR=red]!!! found $rem='$' !!![/color]
The data in 4.line:
'        THIS IS TEST$'
The data in 5.line:
'        BY \LAD:PROG$'
The data in 6.line:
'        *A-OK FOR 20'05$'
The data in 7.line:
''
You see - your program reads the data line by line. So when you match the regex, then you have in the variable $line only the 3.line. Therefore in your case it doesn't matter if you use multiline regex (with option s) or not, you match everytime only the character '$', because the other lines are not in your variable $line.

My approach is very different:
I read at once all lines in the variable $lines at this place
Code:
[url=http://perldoc.perl.org/functions/my.html][black][b]my[/b][/black][/url] [blue]$lines[/blue] = [url=http://perldoc.perl.org/functions/join.html][black][b]join[/b][/black][/url][red]([/red][red]'[/red][purple][/purple][red]'[/red], <DATA>[red])[/red][red];[/red]
and therefore I can use succesful the multi-line regex.

Did you understand?

Here is the corrected source, which match your data
Code:
[url=http://perldoc.perl.org/functions/use.html][black][b]use[/b][/black][/url] [green]strict[/green][red];[/red]
[black][b]use[/b][/black] [green]warnings[/green][red];[/red]

[url=http://perldoc.perl.org/functions/my.html][black][b]my[/b][/black][/url] [blue]$lines[/blue] = [url=http://perldoc.perl.org/functions/join.html][black][b]join[/b][/black][/url][red]([/red][red]'[/red][purple][/purple][red]'[/red], <DATA>[red])[/red][red];[/red]
[url=http://perldoc.perl.org/functions/print.html][black][b]print[/b][/black][/url] [red]"[/red][purple]The data is:[purple][b]\n[/b][/purple][purple][b]\n[/b][/purple]'[blue]$lines[/blue]'[purple][b]\n[/b][/purple][purple][b]\n[/b][/purple][/purple][red]"[/red][red];[/red]

[olive][b]if[/b][/olive] [red]([/red][blue]$lines[/blue] =~ [red]/[/red][purple]INFO:(.*)[/purple][red]/[/red][red]s[/red][red])[/red] [red]{[/red]
  [black][b]my[/b][/black] [blue]$info[/blue] =[blue]$1[/blue][red];[/red]
  [blue]$info[/blue] =~ [red]s/[/red][purple][purple][b]\n[/b][/purple][/purple][red]/[/red][purple][/purple][red]/[/red][red]g[/red][red];[/red]
  [black][b]print[/b][/black] [red]"[/red][purple]Info = '[blue]$info[/blue]'[purple][b]\n[/b][/purple][/purple][red]"[/red][red];[/red]
[red]}[/red]

[gray][i]# your data:[/i][/gray]
[teal]__DATA__[/teal]
[teal]Date: 08/01/09          By: LAdProg[/teal]

[teal] INFO:$[/teal]
[teal]        THIS IS TEST$[/teal]
[teal]        BY \LAD:PROG$[/teal]
[teal]        *A-OK FOR 20'05$[/teal]
[tt]------------------------------------------------------------
Pragmas (perl 5.10.0) used :
[ul]
[li]strict - Perl pragma to restrict unsafe constructs[/li]
[li]warnings - Perl pragma to control optional warnings[/li]
[/ul]
[/tt]
Output:
Code:
The data is:

'Date: 08/01/09          By: LAdProg

 INFO:$
        THIS IS TEST$
        BY \LAD:PROG$
        *A-OK FOR 20'05$
'

Info = '$        THIS IS TEST$        BY \LAD:PROG$        *A-OK FOR 20'05$'
 
Yep i understand. I realized that when you posted and did couple more tests when I understood it works very different going by line vs. reading all lines at once.

Unfortunately, i need to go by line.

what i was able to do though is
Code:
  if($lines=~/INFO:(.*)/s) {
    @data = split(/\$/, $lines);
    $nextLine = <DATA>;
    print "$nextLine";
  }

but i need to keep going to next line until i find 'stop' to save all the data in info.. i don't know what is the best way to put all data from info into a variable... :(
 
Hi LAdProg2005,

I supposed that the stop is marked by 05$
Then something like this processes your data line by line

Code:
[url=http://perldoc.perl.org/functions/use.html][black][b]use[/b][/black][/url] [green]strict[/green][red];[/red]
[black][b]use[/b][/black] [green]warnings[/green][red];[/red]

[url=http://perldoc.perl.org/functions/my.html][black][b]my[/b][/black][/url] [blue]$info_found[/blue] = [fuchsia]0[/fuchsia][red];[/red]
[black][b]my[/b][/black] [blue]$infolines[/blue] = [red]'[/red][purple][/purple][red]'[/red][red];[/red]
[black][b]my[/b][/black] [blue]$line[/blue] = [red]'[/red][purple][/purple][red]'[/red][red];[/red]

[olive][b]while[/b][/olive][red]([/red][blue]$line[/blue] = <DATA> [red])[/red][red]{[/red]
  [url=http://perldoc.perl.org/functions/chomp.html][black][b]chomp[/b][/black][/url][red]([/red][blue]$line[/blue][red])[/red][red];[/red]
  [gray][i]# at the first INFO-line[/i][/gray]
  [olive][b]if[/b][/olive] [red]([/red][blue]$line[/blue]=~[red]/[/red][purple]INFO:[/purple][red]/[/red][red])[/red] [red]{[/red]
    [gray][i]# mark when INFO-line begins[/i][/gray]
    [blue]$info_found[/blue] = [fuchsia]1[/fuchsia][red];[/red]
    [blue]$infolines[/blue] = [red]'[/red][purple][/purple][red]'[/red][red];[/red]
  [red]}[/red]
  [gray][i]# while the line is INFO-line concatenate lines[/i][/gray]
  [olive][b]if[/b][/olive] [red]([/red][blue]$info_found[/blue][red])[/red] [red]{[/red]
    [blue]$infolines[/blue] .= [blue]$line[/blue][red];[/red]
  [red]}[/red]
  [gray][i]# at the last INFO-line[/i][/gray]
  [olive][b]if[/b][/olive] [red]([/red][blue]$line[/blue] =~[red]/[/red][purple]05[purple][b]\$[/b][/purple][/purple][red]/[/red][red])[/red] [red]{[/red]
    [gray][i]# mark when INFO-line ends[/i][/gray]
    [blue]$info_found[/blue] = [fuchsia]0[/fuchsia][red];[/red]
    [gray][i]# finally process result and print[/i][/gray]
    [blue]$infolines[/blue] =~ [red]s/[/red][purple][purple][b]\s[/b][/purple]+[/purple][red]/[/red][purple] [/purple][red]/[/red][red]g[/red][red];[/red]
    [url=http://perldoc.perl.org/functions/print.html][black][b]print[/b][/black][/url] [red]"[/red][purple][purple][b]\$[/b][/purple]infolines = '[blue]$infolines[/blue]'[purple][b]\n[/b][/purple][/purple][red]"[/red][red];[/red]
  [red]}[/red]
[red]}[/red]


[gray][i]# your data:[/i][/gray]
[teal]__DATA__[/teal]
[teal]Date: 08/01/09          By: LAdProg[/teal]

[teal]INFO:$[/teal]
[teal]        THIS IS TEST$[/teal]
[teal]        BY \LAD:PROG$[/teal]
[teal]        *A-OK FOR 20'05$[/teal]

[teal]Date: 09/09/09          By: mikrom        [/teal]
[teal]INFO:$[/teal]
[teal]        THIS IS OTHER TEST$[/teal]
[teal]        BY \MIKROM:PROG$[/teal]
[teal]        *A-OK FOR 20'05$[/teal]
[tt]------------------------------------------------------------
Pragmas (perl 5.10.0) used :
[ul]
[li]strict - Perl pragma to restrict unsafe constructs[/li]
[li]warnings - Perl pragma to control optional warnings[/li]
[/ul]
[/tt]

Output:
Code:
$infolines = 'INFO:$ THIS IS TEST$ BY \LAD:PROG$ *A-OK FOR 20'05$'
$infolines = 'INFO:$ THIS IS OTHER TEST$ BY \MIKROM:PROG$ *A-OK FOR 20'05$'
 
stop is just terminator to stop looking for info data. in my case it is either next empty line or word stop in next line.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top