セント" />
![]() |
Helloやアメリカ合衆国へようこそ! UNIXおよびLinuxフォーラム!訪問し、当社のグローバルコミュニティに参加いただきありがとうございます。
|
|
|
|
||||
|
ヘルプのXML
グループは、
コード:
$ cat 2233
12236 ID2
12239 ID3
Please guide me to construct the following XML from the above input.
<Comp>
<main>
<hlp fS="12236" eS="12237">
<std no="2233" />
<id="ID2"/>
</hlp>
<hlp fS="12239" eS="12240">
<std no="2233" />
<id="ID3"/>
</hlp>
</main>
</Comp>
** eS is +1 of fS value
** std no is the file name
|
|
||||
|
perlの
下にしてくださいハイ perlの スクリプト
a.plは、スクリプト名は、以下のコマンドを問題に取り組むことができるという。 引用:
コード:
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);
|