Example: I'd like to split $2
in input file, putting a tab
after pattern surname
Input:
name surname1
name surname30000
name surname456
Desired output:
name surname 1
name surname 30000
name surname 456
Example: I'd like to split Input:
Desired output:
|
|||
|
An awk alternative:
This will match only the numeric string at the end of the second column. |
|||
|
You can lookup the first digit and replace it by a tab followed by the digit using:
|
|||
|
adds a tab before the first digit on every line. Output:
|
|||
|
The data might be in a specific column, e.g., 16:
Alternatively, the data of interest in the third field may not be numeric:
Either of these will put a space before the digits (or other non-alphabetic) characters in the data. For reference: |
|||
|