in reply to Re^2: how to extract certain lines
in thread how to extract certain lines

i type a few lines here but when i create, it becomes one long sentence?

Replies are listed 'Best First'.
Re^4: how to extract certain lines
by mscerra (Monk) on Oct 26, 2004 at 03:37 UTC
Re^4: how to extract certain lines
by neilh (Pilgrim) on Oct 26, 2004 at 03:37 UTC
    If it is all in one line, you could split it on the ; and do something like the following:

    while (<DATA>) { my @split=split/;/; foreach (@split) { if (/\bHERE IS THE DATA PLACED (\w+)/) { s/\bHERE IS THE DATA PLACED//; print $_; #print "Matched\n"; }else{ next; } } } __DATA__ HERE IS THE DATA PLACED ABC; DO NOT ENTER PLACED BCD; HERE IS THE DATA + PLACED ABC; WHO ARE U PLACED ABC ; __OUTPUT__ ABC ABC

    Neil

Re^4: how to extract certain lines
by dee00zee (Novice) on Oct 26, 2004 at 04:00 UTC
    the data im trying to type example
    HERE IS THE DATA
    PLACED ABC