94

Since 2.16, you can edit field names in the layer properties when editing is enabled: Renaming is possible using Table Manager plugin (http://plugins.qgis.org/plugins/tablemanager/)


61

UPDATE 13.10.2016: Right click on the layer in the Table of Contents (aka. legend or layer tree) and open the Save As... dialog. Once there, click on the Format option list and choose MS Office Open XML spreadsheet [XLSX]. Note that you also have an option for Libre Office files: Open Document spreadsheet [ODS]. I'm using QGIS v.2.14.4 PREVIOUS ...


55

Just put $rownum (QGIS 2) or @row_number (QGIS 3+) as the expression. Simple as that. :) An up-to-date list of all the field calculator functions can be read in the official docs.


37

I once had the same question. The answer is that you put a file in the same folder with the ending csvt. For example your file name is xyzdata.csv you add the file xyzdata.csvt This one you can edit with editor for example. And in it you set the data type like this. "Integer","String","Integer","Integer","String","Real" Integer is now the variable for the ...


36

A centroid is per definition a point layer and not a polygon. Therefor you need to create a new layer, which is easy as pie in QGIS 1.8 and higher versions. Load in your polygon Go to the menu -> Vector -> Geometry tools -> polygon centroid and create a centroid point layer Export the coordinates of the created centroid to the attribute table by clicking on ...


28

Since QGIS 2.16 you no longer need a plugin to do this - you can double click a field name in a shapefile from the vector layer properties window and rename (set the layer as editable first)


26

To get a csv file of the attribute table, rightclick on the layer in the legend, select Save As ..., and change the file format from shapefile to CSV. You might need to change the separator from comma to semicolon in a text editor if Excel does not like the default separator.


23

It means that the field is indexed. You can change the character used to indicate whether a field is indexed under the Table Options > Appearance menu:


22

Many operators and functions in SQL (and therefore expressions) return NULL if one of the parameters was NULL The following examples demonstrate the behavior of various operators on a layer with the columns A and B. "A" + "B" NULL + 'text' ➝ NULL 'a' + 'b' ➝ 'ab' "A" || "B" NULL || 'text' ➝ NULL 'a' || 'b' ➝ 'ab' CONCAT("A", "B") CONCAT(NULL, 'text') ➝...


21

I think what you might be trying to do is NOT use "fully qualified table names". To do so, in Environment Settings -> General Setting, uncheck "Maintain fully qualified name". Take a look at this Esri support forum and this online help article. Note this will work when joining DBF files but not when joining CSVs. (As a work-around you can convert ...


21

A more elegant solution is: "Classes" in ('14','15',....)


21

You can now rename a field using core ArcGIS Desktop GP tool - Alter Field (Data Management). This tool provides the ability to rename fields or rename field aliases for any geodatabase table or feature class. I have not installed 10.2.1 on a virtual machine yet (was released just a day ago), but my guess is that by feature class here Esri means both ...


20

You can do this with the Summary Statistics (Analysis) tool. The case field parameter is what you use to "dissolve". From the above link: case_field [case_field,...] (Optional) The fields in the Input Table used to calculate statistics separately for each unique attribute value (or combination of attribute values when multiple fields are specified).


20

There is now a build in solution, called Refactor fields, you can find it in the Processing Toolbox under Vector table tools. The as solution marked table editor plugin is no longer a working solution as it's being deprecated.


20

You can set the Attribute Table to be in a dock window which allows you to 'fix' to certain positions. You can set this by going to: Settings > Options > Data Sources > Open attribute table in a dock window You will need to restart QGIS for this to take effect: Now when you access the Attribute Table, it may appear at the bottom. Just drag this ...


19

By default the F6 key is the shortcut to open the attribute table of the layer selected in the Layers Panel in Windows. If there is no default shortcut (which is the case in QGIS on MacOS) or you want to change the shortcut, you can go to "Settings - Configure Shortcuts" and select your own shortcut key combination.


18

Have a look at the "Overriding how text files are formatted" section in the help topic on Adding an ASCII or text file table: You can override how delimited text files are displayed within ArcGIS by using the schema.ini files. An example of when you would want to use the schema.ini file to override the default behavior is when ArcGIS is ...


17

In QGIS open your attribute table and click the "Select Features Using an Expression" button. To find all the null records for a field in a shape file your query will look like: "field_name" is null You can find your field name in the Fields and Values list, double click the field you want to get it into the Expression box. Make sure you SELECT the new ...


17

In short you cannot change a field name in a shapefile. What you need to do is create a new field of the same type but with your new name then copy the contents of the old field into it, then delete the old field.


16

You can use Table Manager Plugin in QGIS to rename, delete and sort table attributes. You can try harmonize the shapefiles structure. There is one limitation, Table manager won't be able to change attribute types. If you have an attribute that is a "text" in one shapefile and a "integer" in the other, you have to create a temporary attribute and convert the ...


16

I discovered the solution to this by accident a couple of weeks ago. It's so simple it's almost too good to be true: Select the formatted cells of interest in Excel, Copy, then Paste into an active Arcmap Layout dataframe. Size and place to suit. Done. To ensure you don't get any jpeg jaggies use the same font size in Excel as you would in Arcmap if it ...


16

I think the problem is likely your two lines where you are going over the fields and appending each field individually to your subdict dictionary. for field in valid_fields: subdict[field] = row[cursor_fields.index(field)] Your row object is already a tuple in the same order as your fields, take advantage of that and use the zip function. def ...


16

By default CSV layers cannot be edited. You have to save to a different format, e.g. Shapefile, before you can start editing. Update 2015-11: There's a new plugin that solves this issue called Editable GeoCSV. It can handle x and y columns for points or a WKT column. For more details see http://giswiki.hsr.ch/Editable_GeoCSV_QGIS_Plugin


15

Rather than messing with the input file, trying to get everything picture perfect, just use the field calculator to convert the text to a number / real. See the examples below:


15

The Plugin 'Table Manager' does what you want.


15

In newer versions (I used QGIS 2.18.9) if you right-click on the layer -> "Save As..." you can toggle "Select fields to export and their export options". There you can select all the fields you want to export. Optional: In the Save As-window - Scroll down to "Datasource Options", you can add the selected field name to "DescriptionField" or "NameField". For ...


15

You need to click on the Switch to table view button:


15

You could use field calculator and follow these steps: 1- Create new field (string) 2- Use "Coalesce" Function coalesce( "Value 1" , "Value 2" , 'value if No data') Colaesce function returns the first not NULL


14

Without knowing what your data looks like, the general syntax you need to insert into the select by attributes window is: [FIELD_1] IS NULL OR [FIELD_2] IS NULL OR [FIELD_3] IS NULL and so on for as many fields as you have to work with. For reference the full query would be: SELECT * FROM [TABLE_NAME] WHERE [FIELD_1] IS NULL OR [FIELD_2] IS NULL OR [...


14

This should do it and is a little simpler than the examples in the online help for UpdateCursor which is nevertheless worth a read. I've assumed your shapefile is in a folder called C:\temp and that structuretype is an integer field. If it is a text field just use "3" and "4" instead of 3 and 4. import arcpy features = arcpy.UpdateCursor(r"C:\temp\...


Only top voted, non community-wiki answers of a minimum length are eligible