in reply to Re^5: create an xml file from column file
in thread create an xml file from column file
is it possible to do without CSV .The code i wrote is below.But the required output is not coming
$out=" "; my @text; while(<>) { chomp; @arr=split(/\s+/,$_); push @r,$arr[0]; push @e,join' ',($arr[0],$arr[2]); } print '<text>'; print join ' ',@r; print '</text>'; print"\n"; for my $a (@e) { @q=split(/\s/,$a); if($q[1]=~/^B-/) { $p=$'; $m=$q[0] if( $q[1] =~/^B-/ or $q[1]="o"); $out.="<annotation>\n<key=type>$p</type>\n<text>$m</text>\n</annotatio +n>\n"; } } print"$out\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: create an xml file from column file
by hdb (Monsignor) on Jul 25, 2013 at 09:46 UTC | |
by lakssreedhar (Acolyte) on Jul 25, 2013 at 11:02 UTC | |
by hdb (Monsignor) on Jul 25, 2013 at 11:04 UTC |