View Single Post
Old 10-25-2015, 06:23 PM   #4
geniale
Member
geniale began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Sep 2015
Device: none
Quote:
Originally Posted by theducks View Post
The Regex only works within a book and you can only open 1 book in an editor session.
Besides, I don't see how REGEX is a simple solution. You need to identify the target.

If you have multiple monitors, you could use the CLI to open 2 editor sessions (2 Monitors leaves both in front ) and copy and paste between
My origin file: cap1_es
My origen text: <a data-index="18es"><sup class="bkm">18</sup></a>

My target file: cap1_en
My target text: <sup class="bkm">18</sup>

I want this origen text <a data-index="18es"> in the target text.

I have found this in a web site:
Capture the group you're interested in (ie, between quotes), extract the matches from each line, then write them one per line to the new file, eg:

import re

with open('input') as fin, open('output', 'w') as fout:
for line in fin:
matches = re.findall('"(.*?)"', line)
fout.writelines(match + '\n' for match in matches)

Is it a possible solution?
geniale is offline   Reply With Quote