Last active
August 12, 2016 12:46
-
-
Save cejojohn/4336ba1714f398d0fc8508a6f3e0ac3f to your computer and use it in GitHub Desktop.
Deleting blank spaces from files. I used it along with my scripts to configure the rsyslog server. I was provided with a jumbled list of more than hundred network switches.
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
#!/bin/bash | |
#To delete all whitespace: cat file.txt | tr -d "[:space:]" | |
#To delete all horizontal whitespace: cat file.txt | tr -d "[:blank:]" | |
#Using LibreOffice calc in the final stage I had two columns to merge. Eg: | |
/var/log/Switches/ Switch1 | |
/var/log/Switches/ Switch2 | |
. . | |
. . | |
. . | |
. . | |
. . | |
#So I did: | |
cat filename | tr -d "[:blank:]" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment