I've two text files. I want to take text from first one between </sup><sup>
tags, and insert it to another text file between {}
.
Better example (sth like a dictionary)
Text1:
<sup>1</sup>dog
<sup>2</sup>cat
<sup>3</sup>lion
<sup>1</sup>flower
<sup>2</sup>tree
.
.
Text2:
\chapter1
\pkt{1}{}{labrador retirever is..}
\pkt{2}{}{home pets..}
\pkt{3}{}{wild cats..}
\chapter2
\pkt{1}{}{red rose}
\pkt{2}{}{lemon tree}
.
.
What I want:
Text3:
\chapter1
\pkt{1}{dog}{labrador retirever is..}
\pkt{2}{cat}{home pets..}
\pkt{3}{lion}{wild cats..}
\chapter2
\pkt{1}{flower}{red rose}
\pkt{2}{tree}{lemon tree}
Text is random, but You can see what I want. Perl would be best.
So get
</sup>**text**<sup>
and paste it to
\pkt{nr}{**here**}{this is translation of this word already stored in text2}.
Text A and B are in order, so if I could read first </sup>text<sup>
from Text A, save it in temp, delete this line from Text A, put it on first free {}
slot in text B, and start over again it would be great. Numbers will match because order is saved.
Sorry for my English:)
Thanks!