I need some ideas for parsing a multi-line message block and reformat
into columnar output

1. message block is bound by a begin and end tags {begin} {end}
2. within the message blocks are tags for column data :1: :34:

sample message blocks with column data

{begin}
:1:some text 1
:34:1234,00
:33:text
with continuation
{end}
{begin}
:2:some text 2
:34:456,99
:33:text
{end}

reformat to csv

tag1,tag2,tag33,tag34
"some text 1",,"text with continuation".1234,00
,"some text 2","text".456,99

I am considering parsing line by line with a structure like this
pseudo code

look for begin tag
if defined begin tag{
look for a tag until end tag found or no more
  if defined tag{
    is it tag 1(....)
    is it tag 2(....)
    is it tag 33(....)
    is it tag 34(....)  
    is it end tag(write csv)  
  }
}



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to