User Tools

Site Tools


awk:find_and_replace_a_string

AWK - Find and replace a string

awk '{gsub(/old_string/, "new_string")};{print}' file.txt

Find either of the old strings and replace with the new string.

awk '{gsub(/old_string1|old_string2|old_string3/, "new_string")};{print}' file.txt
awk/find_and_replace_a_string.txt · Last modified: 2020/09/23 16:16 by 192.168.1.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki