in reply to Re: convert to XML
in thread convert to XML
#!/usr/bin/perl print qq|<?xml version="1.0"?>|; print "\n"; while($_ = <DATA>){ if (/^\[\w+\]/ .. /^\[\w+\]/) { $save = $_; $save =~ s/\[/</g; $save =~ s/\]/>/g; print $save; } }
I have tried sometime like this. But I am not able to store the values in a variable__DATA__ [DATA] data1 [ENTRY] entry here [STORY] story details [DATA] [ENTRY] another entry here [STORY] another story
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: convert to XML
by rovf (Priest) on Aug 12, 2009 at 08:58 UTC |