Last active
June 19, 2017 03:48
-
-
Save sevaine/9244719 to your computer and use it in GitHub Desktop.
remove all letters and numbers, replace space with underscore using awk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat ${logfile} | awk '/^[A-Za-z0-9]/{gsub("[A-Za-z0-9]", "");gsub(" ","_");print}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
simpler alternative:
awk '/^[A-Za-z0-9]/{gsub("[A-Za-z0-9]", "");gsub(" ","_");print}' <FILE>