Skip to main content
edited body
Source Link
Joules
  • 445
  • 2
  • 6
  • 19

I can't find an expression to add a character every nth character from the right of a string, in field calculator.

As an example, I have a list of UK postcodes which I need to add a space to 3 characters from the right:

From: N165KP To: N16 5KP

Note this has to be done from the right as the first lot of characters (before the space) can vary in numberlength.

I can't find an expression to add a character every nth character from the right of a string, in field calculator.

As an example, I have a list of UK postcodes which I need to add a space to 3 characters from the right:

From: N165KP To: N16 5KP

Note this has to be done from the right as the first lot of characters (before the space) can vary in number.

I can't find an expression to add a character every nth character from the right of a string, in field calculator.

As an example, I have a list of UK postcodes which I need to add a space to 3 characters from the right:

From: N165KP To: N16 5KP

Note this has to be done from the right as the first lot of characters (before the space) can vary in length.

Source Link
Joules
  • 445
  • 2
  • 6
  • 19

Add a character every nth character in QGIS Field Calculator

I can't find an expression to add a character every nth character from the right of a string, in field calculator.

As an example, I have a list of UK postcodes which I need to add a space to 3 characters from the right:

From: N165KP To: N16 5KP

Note this has to be done from the right as the first lot of characters (before the space) can vary in number.