02-27-2006
Try this
Use fold
For eg:
For specifying number of columns.
fold -w 587 <filename>
For specifying number of bytes.
fold -b 587 <filename>
Remember this works on the stream. So capture the output in another file.
5 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have a requirement, where based on a particular character on a single line, the data has to be written to new lines...
Ex: abccd$xyzll$bacc$kkklkjl$albc
My output should be
abccd$
xyzll$
bacc$
kkklkjl$
albc
Can someone help on this. (1 Reply)
Discussion started by: thanuman
1 Replies
2. UNIX for Dummies Questions & Answers
Can someone help , how to add a terminator at the end of each line through shell command.
ex:
input file:
abc
xyz2
outputfile (terminator is !)
abc!
xyz2! (1 Reply)
Discussion started by: thanuman
1 Replies
3. Shell Programming and Scripting
I am using the following script. I am basically trying to enter data to my database using a storeprocedure.
PFB MY script.
#!/bin/csh -f
foreach FF (`cat ADDUSERS`)
isql -VENKIDB -U gloss -P glosss << _endl
set nocount on
go
use VENKI_PROD
go
print "Adding the user to GSTB... (6 Replies)
Discussion started by: venkidhadha
6 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I am trying to install Terminator (terminal emulator) on SunOS 5.10.
But on their page I do not see download for this one:
code . google . com / p / jessies / downloads / list
software . jessies . org / terminator / #downloads
Did anyone manage to to this, and if it is, can please give... (3 Replies)
Discussion started by: spuzh
3 Replies
5. Shell Programming and Scripting
Hello All,
I have csv file like this
1,"suzi","305
Barehills","Vancover",34256
2,"molly","456
beverleyhills","Minisotta",234876
I want to put a customized record terminator on every alternate lines of this file.
The file is a input to database and the record terminator is by default... (3 Replies)
Discussion started by: nnani
3 Replies
FOLD(1) User Commands FOLD(1)
NAME
fold - wrap each input line to fit in specified width
SYNOPSIS
fold [OPTION]... [FILE]...
DESCRIPTION
Wrap input lines in each FILE (standard input by default), writing to standard output.
Mandatory arguments to long options are mandatory for short options too.
-b, --bytes
count bytes rather than columns
-s, --spaces
break at spaces
-w, --width=WIDTH
use WIDTH columns instead of 80
--help display this help and exit
--version
output version information and exit
AUTHOR
Written by David MacKenzie.
REPORTING BUGS
Report fold bugs to bug-coreutils@gnu.org
GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
General help using GNU software: <http://www.gnu.org/gethelp/>
Report fold translation bugs to <http://translationproject.org/team/>
COPYRIGHT
Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
SEE ALSO
The full documentation for fold is maintained as a Texinfo manual. If the info and fold programs are properly installed at your site, the
command
info coreutils 'fold invocation'
should give you access to the complete manual.
GNU coreutils 8.12.197-032bb September 2011 FOLD(1)