3

I would like to delete a bracket ([]) in one column of my attribute table. I have different numbers in the column, written like this "[901], [555]..." How can I delete the bracket, withouth having to edit each field?

I am using QGIS version 2.12.3-Lyon.

1 Answer 1

2

If you want to delete all brackets in the column you go for:

replace("your_column",'[','')

It searches for all the brackets and replaces them by nothing.

If it needs to be a special position where the brackets are you need to find them:

For example by position with left, right or substr functions when the position is always the same in each line.

If not you need to find the position dynamicly with strpos or you use regular expressions with regexp_replace.

1
  • Perfect! Thats exactly what I needed!! thanks a lot
    – user69896
    Commented Jun 6, 2016 at 9:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.