hi try below
perl scirpt
say the script name is a.pl, below command can address your issue.
Code:
format STDOUT_TOP =
<Comp>
<main>
.
format STDOUT =
<hlp fs="@<<<<" es="@<<<<">
$text1 $text2
<std no="@<<<"/>
$text3
<id="@<<"/>
$text4
</hlp>
.
$file=shift;
open(FH,"<$file") or die "Can not open file";
while(<FH>){
@arr=split(" ",$_);
$text1=$arr[0];
$text2=$arr[0]+1;
$text3=$file;
$text4=$arr[1];
write;
}
print " </main>\n";
print "</Comp>\n";
close(FH);