「 」タグ.xml
を検索する必要があるファイルがあります。<reviseddate>
ファイル内に複数回存在する可能性があります。<reviseddate>
その場合、「 」タグを「 」に置き換える<reviseddate1>
必要があります。これにはシェルスクリプトが必要です
テキストのサンプルは次のとおりです。
Manuscript received <receiveddate>June 7, 2005</receiveddate>; revised
<reviseddate> February 4, 2006 </reviseddate>, <reviseddate> August 14, 2006 </reviseddate>,
and <reviseddate> October 7, 2006 </reviseddate>. This work was supported by the
<supported><agency-name>California Department of Transportation through the California
Center for Innovative Transportation and the California Partners for Advanced Highway
and Transit Program</agency-name><grant-grp/></supported>. The contents of this paper
reflect the views of the authors and do not necessarily indicate acceptance by the
sponsors. The Associate Editor for this paper was M. M. Sokoloski.</affnote-para>
出力は次のようになります
Manuscript received <receiveddate> June 7, 2005 <receiveddate>; revised
<reviseddate1> February 4, 2006 </reviseddate1>, <reviseddate2> August 14, 2006 </reviseddate2>,
and <reviseddate3> October 7, 2006 </reviseddate3>. This work was supported by the
<supported><agency-name>California Department of Transportation through the California
Center for Innovative Transportation and the California Partners for Advanced Highway
and Transit Program</agency-name><grant-grp/></supported>. The contents of this paper
reflect the views of the authors and do not necessarily indicate acceptance by the
sponsors. The Associate Editor for this paper was M. M. Sokoloski.</affnote-para>
私はもう試した:
for i in $c do
sed -e "s/<reviseddate>/<reviseddate$i>/g" $path/$input_file > $path/input_new.xml
cp $path/input_new.xml $path/$input_file
rm -f input_new.xml
done