Questions tagged [string]
A sequence of characters.
183
questions
3
votes
1
answer
69
views
Making new field with formatted values in QGIS
I have a column called "Kiinteistötunnus". The values are in the form 73479400010025.
Values in the whole column should be changed to form 734-794-0001-0025.
The data type is Integer64. ...
1
vote
1
answer
25
views
Is it possible to overline labels / text / strings in QGIS 3.x?
I would like to overline the denominator in these fractions.
Underlining the numerator would result in too short a line when the numerator is shorter than the denominator.
The numbers in this image ...
1
vote
0
answers
16
views
Alternate view to normal view in attribute table [closed]
I have somehow accidentally changed how my attribute table looks and I dont know how to get it to go back to the original state has anyone any idea how to change?
0
votes
1
answer
63
views
psycopg2 cursor.copy_expert() BadCopyFileFormat: extra data after last expected column when writing WKB data
I am trying to write a WKB representation (i.e. a binary string) of a Shapely Polygon into a PostgreSQL/PostGIS database using psycopg2 cursor.copy_expert() for a bulk insert.
I narrowed down the ...
4
votes
2
answers
195
views
Geopackage in QGIS: Search and replace in all attribute fields at once
The context
I have a Geopackage file opened in QGIS. It was created by importing a CSV file. However, when importing, something regarding encoding went wrong: I have several special characters like ...
4
votes
4
answers
119
views
Removing file type from attribute table in QGIS
I imported a shapefile that contains track plots of SGY files into QGIS, and I would like to remove '.sgy' from the file names in the attribute table.
In the image, I've highlighted the section of ...
0
votes
0
answers
31
views
Double "foreach" - replace text in string when matching text in list using FME
I have a dataset containing texts for translation using Azure's Cognitive Services, and another dataset containing the names of points of interests (and their geolocations). Multiple matches can occur....
1
vote
0
answers
24
views
How to use WFS to update the value of a field to an empty string '', not Null?
I tried to set a field value of a feature to an empty string '' via WFS, but I didn't find a way to make it happen. I use the WFS protocol to send to Geoserver.
I tried the following three methods:
1.
...
3
votes
2
answers
126
views
Replace all but coordinates from a WKT string, including closing bracket ')'
To get a list of coordinates from a polygon and remove unwanted parts from the resulting string, the following expression works fine to remove the string elements 'Polygon', spaces and opening ...
4
votes
4
answers
175
views
Extracting number with letter from the address string in QGIS [closed]
I have the following address examples to extract:
4A MANOR FARM CLOSE
38A OXFORD ROAD
56A BISHOPSTONE
and after using the following codes:
regexp_substr( "Address L2", '(\\d*) ' )
or
...
6
votes
1
answer
70
views
Extracting part of string from two columns at once in QGIS
I would like to extract numbers from two columns at once because I have the situation you see below.
regexp_substr(regexp_substr("Address L1", '(\\d*) ')("Address L2"), '(\\d*)')
...
7
votes
3
answers
221
views
Extracting two last characters (numbers) doesn't work properly in QGIS
I have the string CBG/FON/BCK-STO/A1/FDJ10 and I would like to extract the 2 last numbers (sometimes one, sometimes three).
I found some hint here: Splitting string (the last digits) in QGIS
but it ...
4
votes
2
answers
194
views
Replace using regular expression in QGIS: how to mask a dot (point)?
In QGIS, I have a string with the pattern (1 character)(1 character)(dot)(number with 1 or more digits).
How can I use regexp_replace() to get the number only?
I tried regexp_replace('ab.27',('(\\D\\D(...
-2
votes
1
answer
49
views
Separating characters using Python Parser of Field Calculator in ArcMap [closed]
How can I separate the characters of a string, for example, three by three with slash letters or dashes and insert them in the Attribute table in ArcMap?
abc-def-gh
a100-b200-c300
4
votes
1
answer
59
views
Retrieve values seperated by comma's in QGIS column
What is the simplest way to retrieve each value to a new column from a string with values separated by commas in QGIS?
My data look kind of like this:
STRING
-----------
wp1,wp2,wp3
but I want
...
2
votes
2
answers
81
views
QGIS select by expression based on different elements concatenated inside a string
Using the field filter or advanced filter expression in the attribute table of QGIS, I want to select features that have values in the first three levels and exclude features that values other than ...
7
votes
4
answers
249
views
Labelling with first letter taken from each word in string using QGIS
I have a field called "Species" which is composed by two words (e.g. 'Robinia pseudoacacia') and I would like to extract the first letter of both the words in order to get two letters (e.g. '...
0
votes
2
answers
152
views
Extract numbers from mixed string (numbers & text) in QGIS
In QGIS 3.18. There are several similar questions such as this one which do not address my exact problem.
I have an attribute of comma-concatenated values containing text and numbers. I would like to ...
3
votes
1
answer
155
views
Removing part of string from the right in QGIS
I am trying to remove the last piece of my string in QGIS.
I want to delete the E10 from the end.
I tried both:
How to easily edit attribute data using Regular Expressions?
regexp_replace("UPRN&...
2
votes
1
answer
49
views
Getting percentage of string values for point layer within polygons of another one
I have two layers. One with polygons of areas of a city. Another one - with points corresponding to buildings. In point layer there is a field with the names of management companies of that buildings. ...
4
votes
2
answers
101
views
Inserting words from field into new column in QGIS
Is there any good expression to extract the first word of a field and put it into a new column? I would like to create a new column without the numeric values and filter out words that are doubled.
...
3
votes
1
answer
288
views
Counting elements in comma-separated string in attribute table in QGIS
One of my column in an attribute table in QGIS is separated by comma (shown by column "N") and I wanted to count elements in it. The column is a text field string.
4
votes
3
answers
247
views
Splitting string with dates by '/'-character and getting ancient/latest date as new column in QGIS
I have dates separated by '/' character in column "date" in format RRMMDD as on the screenshot below:
I want to separate dates into another columns "date_from", "date_to"...
2
votes
1
answer
114
views
QGIS 3 batch processing - INPUT value not correct when autofill
I want to batch process with Clip function (also problem with any other). I have several input layers. I would like to autofill the output Clipped parameter with name of the input feature and _clipped ...
3
votes
2
answers
138
views
Compare strings, extract unique values from one (QGIS)
In QGIS 3.18. I am looking for a field calculator expression able to return the values of a string (comma separated) in Field B which are not* also values of a string in Field A. For example:
Field ...
6
votes
2
answers
338
views
Removing duplicates from string in QGIS
In QGIS 3.18 in a shapefile attribute table, I have some fields with concatenated values (with commas , as the delimiter). Some of the values are duplicate, and I would like to remove them.
For ...
0
votes
1
answer
61
views
Inserting space into string using ArcMap Field Calculator
I am using ArcMap 10.7.1.
I want to insert a space into a string between specific parts of the string using Field Calculator:
!FIELD! .replace("F'target", "F 'target")
Neither 'F' ...
6
votes
2
answers
185
views
Extracting number from address string using QGIS
I have a table with addresses and I need to extract only the number from the attributes.
The format is as follows:
address
VALLEY VIEW HOUSE, 36 HIGH VIEW, USHAW MOOR, DH7 7QQ
35 HIGH VIEW, USHAW ...
1
vote
0
answers
288
views
PyQGIS 'str' object has no attribute 'fields' [closed]
I'm trying to write my first Python script from template in QGIS. I want to delete all fields except specific ones. Therefore I create a list to fill it with all the field names except the specific ...
0
votes
0
answers
31
views
How to input a string (or any type) value to a field for multiple feature layers at once
I work in ArcMap 10.8.1. I added fields to all of my feature layers using Batch Add Field tool. Now I'm trying to find a way to enter values into those fields. Values are identical for each field.
My ...
1
vote
2
answers
31
views
Changing strings with no decimals to have .0 at the end
I have a points layer with a "Name" column.
The "Name" values are strings and similar to
'X501', 'X501.1', and 'X501.2'.
I need to change any values like 'X501' to 'X501.0' and ...
0
votes
1
answer
234
views
What VBScript can I use to populate a field with text using the ArcGIS field calculator?
I need to populate one field in the attribute table of a File Geodatabase with text. Every entry in the field is set to a Null value and text entry isn't conditional upon any other factor. Every entry ...
1
vote
1
answer
27
views
How to use ArcMap python to parse int from a (part of a) string?
I'm using the ArcMap Field Calculator to parse the year from a field GLVertra_1 with values like this:
1992/05/13
or more generally YYYY/MM/DD, but also containing empty cells (or cells appearing ...
7
votes
4
answers
361
views
Inserting additional text into string field with the Field Calculator in QGIS
In QGIS 3.18.3, I have a GeoPackage attribute table containing a string field that I will call "FIELD_1". All records within "FIELD_1" take the form of a_a_a_a_a, where a = ...
1
vote
1
answer
300
views
TerraClimate: Error generating chart: Data column(s) for axis #0 cannot be of type string
I am using "TerraClimate: Monthly Climate and Climatic Water Balance for Global Terrestrial Surfaces, University of Idaho" dataset...
When I try my code, I have this error message Error ...
2
votes
1
answer
324
views
FME: how to replace a character at a specific index?
Suppose I've a string foo,
How can I change the 3rd character (identified by its index) ?
The Ruby equivalent would be
# Define the variable string and assign the value 'bar'
string = 'foo' #=&...
0
votes
1
answer
37
views
Bounding Areas using Feature Collection values (RESOLVE Ecoregions 2017)
I'm pretty new to the Earth Engine and have been working through some of the tutorials to familiarize myself with it. I have very little code experience.
What I am trying to accomplish is creating a ...
2
votes
1
answer
83
views
Changing number of decimal places of a String variable within a Vector Layer using PyQGIS
I have earthquake data and within the data, there are magnitude, longitude and latitude values. However, these values have around 6/7 decimal places but I would like to only have 2 decimal places for ...
7
votes
2
answers
317
views
What is the maximum number of characters for a label in QGIS 3?
I am trying to determine the maximum number of characters for a label in QGIS 3. I am at over 1,000 characters and it does not display. Is there another way to display text on a map with a large ...
7
votes
2
answers
684
views
Deleting any characters after certain character in QGIS label expression
I have a shapefile with attribute values like this:
C834
K9
L523;L553
W2,T48
I want to display only the characters before certain characters, for example ; and , :
C834
K9
L523
W2
How to achieve ...
5
votes
1
answer
407
views
How to use label maximum line length for word wrapping in QGIS 3
I am confused on how to use the maximum line length for word wrapping a label in QGIS 3. The dialog and documentation show an option to "Wrap lines to" and then allow selecting "Maximum ...
3
votes
2
answers
1k
views
Cannot convert '#value!" to double
I am trying to convert a string to a numerical format by creating a new field. I get an error message saying "Cannot convert '#VALUE!' to double." What does this mean?
2
votes
2
answers
449
views
QGIS: Comparing attribute values from different layers with Expression string builder
I want to compare attribute values from different attributes from multiple layers in the Expression string builder in QGIS (3.16.1) in of these layers, but I don't know how to do that.
I've tried out ...
7
votes
1
answer
94
views
Convert a list to string in QGIS
I have edited a field into the attribute form of a QGIS project as a "Value Relation" to create a checkbox where I can choose few possibilities. I have a tree sickness and the field I am ...
1
vote
1
answer
34
views
Selecting features by characters contained in a text string
Is there a way to select the features of a map by finding text within an attribute table? For example, if several features are listed as "Nature preserve" under a column called "...
3
votes
2
answers
694
views
Converting PyQt5.QtCore.QVariant to string
I am using QGIS with the in-built Python console. I want to replace some values in a shapefile with some other values. But when I try to change the attribute values, I get an error about the data ...
3
votes
1
answer
93
views
Selecting in expression features with line break
I'm trying to filter features in a QGIS layer to those with the following in their "description" attribute.
<td>CC_W</td>
<td>3</td>
I think what I need is ...
4
votes
1
answer
151
views
Splitting string into "alphabetic" or "numeric" in QGIS 3.10.1
What are the right functions and formulas with the field calculator to delete "alphabet" or "number" inside a field?
Let me be clear. I want to be able to delete "alphabetic ...
2
votes
1
answer
424
views
Creating new column based on parts of strings in another column in QGIS
I have a column with zoning names (with "subzones" like UV036, UMTs2 etc.) and would like to create a new column with the general zone instead (UV instead of UV036, UMT instead of UMTs2... ...
2
votes
1
answer
22
views
Problem in storing splitted strings in attribute table
I want to split strings of column 'Text' and save them in column 'Text_edit'. So far the split and storing the new values in a new column works. However as can be seen in the attached figure, only the ...