[comp.unix.questions] splitting huge \n-less files

anneb@ai.etl.army.mil (Anne Brink) (07/04/90)

Yesterday, I asked for insight into splitting a long file up that split refused
to handle.  Thanks to everyone who replied.  Solutions included:

1) get a new version of split (found on uunet in bsd-sources/src/usr.bin/
	(info courtesy Jonathan Kamens at MIT, posted yesterday)

2) use a perl script:

	#!/usr/bin/perl
	$out = "xaa";
	while (read(STDIN,$foo,32768)) {
	    open(OUT, '>' . $out++); print OUT $foo;
	}
	(script courtesy Larry Wall, also posted yesterday)

3) several people suggested using dd with the skip= and count= options

4) Do something with compress and pipe through a filter that will put in
   newlines

4) nroff the file
	(from Michael Kosmin)

5) judicious use of tr changing a recurrent character into a \n
	(also from several people)


Once again, thanks!  Now, to work chopping up files......

				-Anne
				anneb@etl.army.mil
-- 
#################################||############################################
  Anne Brink: anneb@etl.army.mil ||U.S.Army Engineer Topographic Labs
    ...!uunet!etl.army.mil!anneb ||Ft. Belvoir, VA 22060-5546
#################################||############################################