[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to do this, fold + split



On Fri, 30 Dec 2011 15:09:13 +0000, T o n g wrote:

> I want to split a file every ### of chars. Is it possible not to split
> on the word but word boundaries?

I was first thought in "awk" but Google suggested "fold":

sm01@stt008:~$ cat Desktop/text.txt
thisis a sample text file to seehow thescript work s...

sm01@stt008:~$ fold -s -w 10 Desktop/text.txt
thisis a 
sample 
text file 
to seehow 
thescript 
work s...

Greetings,

-- 
Camaleón


Reply to: