🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1051

Re: Breaking large file into pieces

#1051
From: Leslie Mikesell
Date: Wed, 12 Sep 1990 19:47
28 lines
1262 bytes
In article <1990Sep11.134238.20218@dg-rtp.dg.com> monroe@dg-rtp.dg.com (Mark A Monroe) writes:
>I want to rip a large file into pieces, naming new files according
>to an ID string in the large file.  For example, the large file contains
>records that look like this:

>xxx-00001239	data	data	data
>description
>       .
>       .
>(variable length)
>       .
>						<---blank line
>xxx-00001489	data	data	data

The perl suggestions are the best if you have perl, and it can be
done directly in awk if you have the new awk that can close files. 
I did this sort of thing years ago using:
 awk |sh
where the awk program generates a stream something like:
 cat > filename1 <<\!EOF
 data
 !EOF
 cat > filename2 <<\!EOF
 data
 !EOF

Les Mikesell
les@chinet.chi.il.us
Technical Details
Message-ID: <1990Sep12.194732.18353@chinet.chi.il.us>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!julius.cs.uiuc.edu!apple!olivea!orc!inews!iwarp.intel.com!gargoyle!chinet!les
References: <1990Sep11.134238.20218@dg-rtp.dg.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!julius.cs.uiuc.edu!apple!olivea!orc!inews!iwarp.intel.com!gargoyle!chinet!les
From: les@chinet.chi.il.us (Leslie Mikesell)
Newsgroups: comp.unix.shell
Subject: Re: Breaking large file into pieces
Message-ID: <1990Sep12.194732.18353@chinet.chi.il.us>
Date: 12 Sep 90 19:47:32 GMT
References: <1990Sep11.134238.20218@dg-rtp.dg.com>
Organization: Chinet - Chicago Public Access UNIX
Lines: 28