kallol.chakra has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I am having a problem.
Lets take this scenario.
The Input data is as follows:
header { subheader1 { field1 : value field2 : value field3: value } subheader2 { subheader3 { field4 : value field5 : value field6: value } subheader4 { field7 : value field8 : value field9: value } } }
header { subheader1 { field1 : value1 field2 : value1 field3: value1 } subheader2 { subheader3 { field4 : value1 field5 : value1 field6: value1 } subheader4 { field7 : value1 field8 : value1 field9: value1 } } }
The output will be :
field1,field2,field3,field4,field5,field6,field7,field8,field9 value,value,value,value,value,value,value,value,value value1,value1,value1,value1,value1,value1,value1,value1,value1
Here main problem is that: The value os field2 or field3 may be missing then the output may be:
field1,field2,field3,field4,field5,field6,field7,field8,field9 value,value,value,,value,value,value,value,value value1,value1,value1,value1,value1,value1,,value1,value1
In the above output The first line field4 is missing and in the second line field7 is missing
How Can I get the output can you please help me.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: String Search
by moritz (Cardinal) on Aug 31, 2009 at 09:05 UTC | |
by kallol.chakra (Initiate) on Aug 31, 2009 at 09:14 UTC | |
by moritz (Cardinal) on Aug 31, 2009 at 09:29 UTC | |
by kallol.chakra (Initiate) on Aug 31, 2009 at 10:12 UTC | |
by Marshall (Canon) on Aug 31, 2009 at 11:33 UTC | |
| |
by Anonymous Monk on Aug 31, 2009 at 10:38 UTC | |
by kallol.chakra (Initiate) on Aug 31, 2009 at 10:20 UTC | |
| |
|
Re: String Search
by bichonfrise74 (Vicar) on Aug 31, 2009 at 19:11 UTC | |
by kallol.chakra (Initiate) on Sep 01, 2009 at 06:11 UTC | |
by Anonymous Monk on Sep 01, 2009 at 07:08 UTC | |
|
Re: String Search
by Anonymous Monk on Aug 31, 2009 at 09:09 UTC | |
by kallol.chakra (Initiate) on Aug 31, 2009 at 09:19 UTC | |
by Anonymous Monk on Aug 31, 2009 at 09:32 UTC | |
by kallol.chakra (Initiate) on Aug 31, 2009 at 10:30 UTC | |
by Anonymous Monk on Aug 31, 2009 at 11:01 UTC | |
by kallol.chakra (Initiate) on Aug 31, 2009 at 10:33 UTC | |
|
Re: String Search
by Anonymous Monk on Sep 03, 2009 at 12:18 UTC |