Skip to contentSkip to conversation

Text Reformatting

DISCUSSION [email protected] 1 participant 1 message May 18, 2003 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Hi,

Quoted 5 lines

cat file.txt | tr -s " " "\012" > file1.txt | fmt -u -w 105 file1.txt > file2.txt

This does not maintain the paragraphs, however. Can sed do it and how?

If there's a blank line between paragraphs, it should work. Otherwise it becomes more difficult. Try opening the file in Vim and running the command

ggVG

which reformats the whole file similar to fmt. If you don't like the result, quit without saving anything:

	:q!

Yawar
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs