I am trying to create a macro that edits the following text:
EN Have you ever been to Florida?
FR Es-tu deja alle (♀allee) en Floride?
IPA [ɛ ty deʒa ale (♀ale) ɑ̃ floʁid ||]
EN We went there on vacation
two (2) years ago.
FR Nous sommes alles (♀allees) en vacances la-bas il y
a deux ans.
IPA [nu sɔm ale (♀ale) ɑ̃ vakɑ̃s laba z‿
i l‿i a do z‿ɑ̃ ||]
EN Did you have a good time?
FR As-tu passe du bon temps?
IPA [a ty pase dy bɔ̃ tɑ̃ ||]
1. all lines beginning with IPA are removed
2. if the IPA line continues on the next line, that next line is removed, also. (that is, delete everything until "EN"
3. If the line starting with FR continues on the next line, it removes the CR/LF so that the two lines become one line.
4. If the line starting with EN continues on the next line, it removes the CR/LF so that the two lines become one line.
5. Remove all lines that don't begin with EN or FR
6. Create two columns where the first column has all lines that begin with EN (the english sentences)
and the second column has all of the lines that begin with FR (the french sentences)
So as you can see, I have files that have an English Sentence followed by a French Sentence followed by the pronunciation, and I am trying to transform them into files that I can use for Anki or Anymemo flashcards.
I can do bits and pieces of this, but the code to concatenate the lines and remove the second line of the pronunciation elude me.
All help appreciated!