Splitting up a too-wide text file

nickolas.landsberg npl at cbnewsi.att.com
Fri Mar 15 13:26:48 AEST 1991


How about the following for those who don't have access to perl and such:
(pseudo Bourne sh, ksh script)

LENGTH=whateveryourlinelength
split -${LENGTH} <file>
for ii in x*  # assumes no other files in directory starting with "x"
do
	A="your_favorite_awk_or_sed_or_cut_or_other_script"
	${A} "args to get first 80 cols" ${ii}
	${A} "args to get next 80 cols" ${ii}
	# more if needed
done
rm -f x??

OK.... I know that it takes mucho disk space if the file is large, but,
honestly, where is there a whole in the above?

Nick Landsberg



More information about the Comp.unix.questions mailing list