8

I have about 19000 records, I added new column and I would like to fill it with string values (eg. brand)- same value for all rows.

I'm not considering copy/paste. I know I could do it with exporting to .csv or something and edit it excel, but that feels a bit... lame and unmethodical? So, any smart solutions?

2
  • I don't have an answer but have the same question. However, when I apply the options described here, the fields in the attribute table I want a value added, does not change. I have 2,473 records and two columns where I want to update with: Column 1: dt_start currently reads NULL, I want it to read 6/3/2009 Column 2: is_complet currently reads ?, I want it to read T I've used Field Calculator, I turned Editing on then off then back on again, what in the world am I missing? Also, how do you highlight the column???? I can't find anything describing this! Thank you for being here and helping!! Kel Commented May 3, 2018 at 21:28
  • Really helpful, thank you, tried typing in letter and then update and didn't work, but replace( 'NULL','NULL','Y' ) worked! Commented May 10, 2019 at 11:08

3 Answers 3

19

Use the Field Calculator. If your column is empty and it has to be filled with the string "mystring" you need to select all the rows of your attribute table and than use the replace function:

replace( 'NULL','NULL','mystring' )
6

If all values are the same, just open your attribute table. choose the column you wish to modify, add the value you want and click on update.

You can also look at a useful plugin called MMQGIS. Where you can export import CSV files....

3
  • 3
    Thanks, I guess it was quite a stupid question. I updated the field using field calculator > string function > title and entered the string)
    – Matos4df
    Commented Apr 17, 2015 at 13:37
  • 1
    @Matos4df - No such thing as a stupid question...otherwise everyone here is a moron :)
    – Joseph
    Commented Apr 17, 2015 at 13:40
  • 1
    +1 Joseph and here is a french saying :il n'y a pas de question idiote seulement une réponse idiote Commented Apr 17, 2015 at 13:50
5

Instead go to field calculator, click on Update existing field, and then select the column where you have to add the value and in below Expression box Add the value in single inverted comma Ex 'No'

1
  • you also need to uncheck - Only update 1 selected feature
    – Dan R
    Commented May 31, 2023 at 0:47

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.