I am trying to remove a random block of characters from the 5th column in a dataset.
Sample data:
A | 12 | AA | 24 | Test to go and keep 192.168.1.1 > 192.168.2.1 | B
Result should look like:
A | 12 | AA | 24 | 192.168.1.1 > 192.168.2.1 | B
I have this so far:
awk 'BEGIN{FS=OFS="|"} {gsub(".*? 192","", $5 )} 1' file.txt
However this removes everything in the 5th column before the last match.
What the code does now:
.168.2.11
I need to remove everything before the first match not last