You are not logged in.

#1 2019-05-25 09:23:23

Registered: 2017-06-29
Posts: 63

[SOLVED] geany: search with regex, but edit just a char

Hello everyone,

I have a badly formatted CSV: beside other things, the comma is both the decimal separator and the cell separator.

Now, the easiest way that came to my mind about how to fix it was: let's find all commas that are between numbers and make those a dot. Then, convert the rest in semicolon.

So I tried searching with geany (regex on) for [0-9],[0-9], and of course it finds them all, but what should I put in the "replace" field to replace just the comma with a dot, as it selects the whole 3 chars? I've been searching for a while, can't find it.


EDIT: I found it myself, sorry for being a noob, still have to learn about the indepths of regex.

The way I've done it has been searching for ([0-9]),([0-9]) and replace with \1.\2

Last edited by devnull (2019-05-25 09:48:12)


#2 2019-08-20 08:13:38

From: Lipsia
Registered: 2015-10-03
Posts: 199

Re: [SOLVED] geany: search with regex, but edit just a char

Hey devnull,

Thanks for posting this here (with the answer you found!).
I use geany quite often and cam across similar problems from time to time.
I tend to use sed in this case but it is not satisfying, so i will give this a try.

naik --greetz

"Kaum macht [Mensch]* es richtig, funktioniert es sofort!"
BL-Kitchen on GitHub


Board footer

Powered by FluxBB