Quantcast
Channel: openSUSE Forums
Viewing all articles
Browse latest Browse all 40713

LEAP 15.1 Multiple search/replace text patterns in one go

$
0
0
Hi,

I need to replace different patterns in a text file, kind of a batch search/replace, and the patterns should be saved and editable to use in other occasions.

For example, an application that would read a pattern file like this:
Code:

"0,01" "0.01"
"0,02" "0.02"
"x y" "X-Y"
...

So a text file like this
Code:

x y 0,01 0,02 z 0.00
would be changed to
Code:

X-Y 0.01 0.02 z 0.00
I want to be able to reuse the pattern file, with eventual edits, in other text files. This doesn't need to change multiple text files, just one each time.

I've looked at Alt. Find & Replace extension to libreoffice writer but it's not obvious how to create batch files, the examples given are quite complex.

Any suggestions for an easy GUI or bash script?

Thanks.

Viewing all articles
Browse latest Browse all 40713

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>