splitting huge \n-less files (a summary)
Anne Brink
anneb at ai.etl.army.mil
Wed Jul 4 03:23:19 AEST 1990
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 at etl.army.mil
--
#################################||############################################
Anne Brink: anneb at etl.army.mil ||U.S.Army Engineer Topographic Labs
...!uunet!etl.army.mil!anneb ||Ft. Belvoir, VA 22060-5546
#################################||############################################
More information about the Comp.unix.questions
mailing list