11

I'm having a bit of trouble here with this situation.

enter image description here

I want "NumeroCamp" only to have the numbers are showing in "Text".

Is there any function in field calculator that could help me with that?

4
  • 1
    See this question here: gis.stackexchange.com/questions/127415/… Commented Feb 13, 2017 at 13:22
  • I want to create a new field in my attribute table by returning all digits between the / and _ characters of the field named "location" by aplying the expression given by @ArMoraer to my situation: regexp_substr( "Text", '/(\\d*)\_' ) However, it does not give the desired result: ![enter image description here](i.sstatic.net/92zAd.png) How could I adapt the expression to my case? Many hanks in advance to anyone who can help or give any suggestions. Commented Sep 4, 2018 at 17:26
  • If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review Commented Sep 4, 2018 at 18:29
  • This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. - From Review Commented Sep 4, 2018 at 20:18

2 Answers 2

19

You can use the following expression in the field calculator (tested on QGIS 2.18):

regexp_substr( "Text", ';(\\d*)\}' )

This will return all digits (as text) between the ; and } characters.

0
1
string_to_array("text",';')[1]

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.