You are not logged in.

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

devnull
Member
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.

Thanks!

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)

Offline

Board footer

Powered by FluxBB