Answer the question
In order to leave comments, you need to log in
Tool for processing a text file with regular expressions and substitution replacement?
I often meet a task at work: there is an xml file in which
<position x="100" y="100" />
and I need to work out all such or similar matches, for example, increase the x coordinate by 2.5 times. I want to find a universal solution for a whole class of such problems. Process some of the lines in the file according to a certain rule and generate a new file.
Answer the question
In order to leave comments, you need to log in
Plus the previous ones for sed and add awk to the answers , also a very powerful thing for processing text files.
If handles, then Sublime text 2. Excellent search for regular expressions, with highlighting and replacement.
some editors (pspad, notepad++ of those that I have installed, for example) can do this
Word processors (perl, php, etc.). Yes, of course, programming text processing scripts is not exactly a “tool”, but it is unlikely that something can make such tasks easier and more automated. In addition to regular expressions, xml can be processed by a full-fledged xpath-aware handler (such as DOMDocument).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question