#!/usr/bin/perl use strict; print qq{<?xml version="1.0"?>\n}; my $tag; while(<DATA>) { chomp; if ( /^\[(\w+)\]/ ... /^\w+/ ) { $tag = $1 if $1; print "<$tag>$_</$tag>\n" if ( ! /^\[/ ); } } __DATA__ [DATA] data1 [ENTRY] entrying here [STORY] story details
In reply to Re: convert to XML
by bichonfrise74
in thread convert to XML
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |