reformating

Vim: How to reformat a set of lines into a single line (if the line is a single sentence)?

Not a dup of http://stackoverflow.com/questions/391710/in-vim-what-is-the-simplest-way-to-join-all-lines-in-a-file-into-a-single-line, as I specifically mean to use the gq reformating functionality. I used to write latex in vim using 80 character textwidth. However, I've now switched to an infinite textwidth, so my lines go on forever. ...

Bash - Format a Textfile - Pair every two lines

Hi, With a simple bash script i generate a text file with many entrys like this: 192.168.1.1 hostname1 192.168.1.2 hostname2 192.168.1.3 hostname3 Now i want to reformat this file, that it looks like this: 192.168.1.1 hostname1 192.168.1.2 hostname2 192.168.1.3 hostname3 Some ideas to solve this? Sed maybe? Thanks for help and be...