3

I'm attempting to remove € symbols from values in the attributes of a geopackage. For example, I have a value 240 123€ that I want to turn into 240 123.

I'm using the field calculator to do this. So far here's what I have written down. regexp_replace("myfield",'(^.*[0-9]+)','\\1')

This gives the same results as regexp_replace("myfield",'([0-9]+)','\\1')

Both of these result in 240 123€.

1
  • note that if you want to turn the value in a "real" number you will need to remove the space (thousand separator) as well... Commented Nov 15, 2022 at 15:55

3 Answers 3

8

Try this instead:

replace("field_name", '€', '')

6

Why so complicated? Simply use: regexp_replace("myfield",'€','') - or even easier: replace("myfield",'€','')

4
left("text",length("text")-1)

would work, too.

2
  • 2
    ...if the symbol to be removed is at the same place all time Commented Nov 15, 2022 at 14:01
  • 2
    I can only work with what OP provides to us @Babel ;-) Commented Nov 15, 2022 at 14:13

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.