Posted: . At: 2:13 PM. This was 13 years ago. Post ID: 1845
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.

Converting a comma delimited file to newline delimited. Using sed to perform the conversion.

Gedit search and replace dialog.
Gedit search and replace dialog.

The search and replace dialog in Gedit. I have used this to convert a comma-delimited file to a newline delimited file. I had saved a huge long list of IP addresses that I had to put into the ban list on my forums, and the list was comma-delimited, but the latest PHPBB software will not accept that and it has to be newline delimited. Therefore I used this to convert the list to a newline delimited format and then it worked perfectly. Putting the ban list into your PHPBB forums will cut down on a massive amount of spam that would normally overwhelm your forums. The ability to convert an entire file from one format to another with one command is why this tip is so useful.

This can also be achieved by typing this in a terminal emulator window.

sed s'/, /\n/gi' banlist.txt > banlistnewline.txt

Using sed makes this very simple. This is why the Linux shell is so powerful, the many commands you can use to manage text files and redirection, as well as the power of sed and awk, make the Linux shell very useful indeed.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.