Created
October 22, 2021 04:17
-
-
Save firedynasty/0d58a95a358a33c45b229792f733c18d to your computer and use it in GitHub Desktop.
delete all comments from a text file
This file contains 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
function delete() { | |
echo "sed -i '' '/^#/d'" | |
echo "sed -i '' '/^$/d;G'" | |
} | |
in command line for mac: | |
$ sed -i '' '/^#/d' (yourfilename here) | |
removes all the lines starting with the symbol (comment) # | |
$ sed -i '' '/^$/d;G' (your filename here) | |
removes all the lines that have multiple lines after running the above command | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment