in reply to Parsing multiple lines into a single line

Can you describe what other words might occur, and how you determine what to do with them? The basic idea is clear: join lines on \, replace whitespace and {} between fields with :. But why is Team 1 discarded but vin(Y) kept? Why ---> before points but not index1 and index2? What exactly determines where a field name starts and ends?
  • Comment on Re: Parsing multiple lines into a single line

Replies are listed 'Best First'.
Re^2: Parsing multiple lines into a single line
by convenientstore (Pilgrim) on Jan 09, 2008 at 01:34 UTC
    After getting the specs per Ysth, do something like below
    { local $/ ; while (<DATA>) { /^name\(([^)]+)\).+\{.+(\w{4}).+(\d).+/sg; print "$3:$2:$1\n"; } } __DATA__ name(DAWSON) { Team 1
Re^2: Parsing multiple lines into a single line
by noobee (Acolyte) on Jan 09, 2008 at 01:45 UTC
    Hi,
    When ever  "Weight: 12.00" occurs in the data, that entire block is discarded. Hence, we discard
    Team 1 { Weight: 12.00; }
    Sorry for not being clear earlier. Appreciate your help.
    --Jessica
Re^2: Parsing multiple lines into a single line
by noobee (Acolyte) on Jan 09, 2008 at 02:10 UTC
    Hi Ysth,
    Whenever we have  Weight: 12.00;
    I need to discard the block in which Weight: 12:00; is present. Hence
    Team 1 { Weight: 12.00; }

    is discarded.
    The  ---> always points right before  points in the data.
    --Jessica