Some text files are shipped as comma-delimited files. This can be annoying to fix, but it can be done with the Linux command line.
Here is an example of comma-delimited text.
jason@jason-desktop:~/Documents$ cat banlist.txt | head -c 200 ; echo 10.34.28.4, 103.11.70.143, 103.11.70.143, 103.22.245.6, 107.20.178.108, 108.163.248.74, 108.21.102.146, 108.62.110.25, 108.62.33.114, 108.62.33.114, 108.62.62.164, 109.162.20.227, 109.162.20.28, 109.1 |
Then I use sed to convert it to newline delimited with a simple command.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | jason@jason-desktop:~/Documents$ sed s'/, /\n/gi' banlist.txt | head -n 20 10.34.28.4 103.11.70.143 103.11.70.143 103.22.245.6 107.20.178.108 108.163.248.74 108.21.102.146 108.62.110.25 108.62.33.114 108.62.33.114 108.62.62.164 109.162.20.227 109.162.20.28 109.162.21.233 109.162.53.96 109.162.53.96 109.162.64.177 109.173.21.1 109.173.69.155 109.195.171.53 |
That is how easy it is to convert a file from comma-delimited to a newline delimited format with one simple command.
This is how to do it.
jason@jason-desktop:~/Documents$ sed s'/, /\n/gi' banlist.txt > banlistnew.txt |