[Tutor] Reading text files

John Choi johnc@greatentertaining.com
Thu, 27 Apr 2000 16:24:59 -0700


This is a multi-part message in MIME format.

------=_NextPart_000_0038_01BFB065.21867A70
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Hi everyone,

I've got another text file question and was hoping I could glean more
knowledge...

Problem:
Over a hundred text files by the following file name convention:

quickYYYYMMDD.txt

For each file, read the 1st and 7th line, and then write those lines to
another file named aggy.txt in the following format:

<1st line>, "~", <7th line>

Any help or suggestions on how to go about doing this would be greatly
appreciated.  As it stands, I'm opening each file copy/pasting the lines.

John Choi
(415) 845-9072

------------------------------------------------------------------
Shooting star of SPAM,
Tail like a greasy white plume,
Gastonomical.
------------------------------------------------------------------
Spam-ku:  Tranquil Reflections on Luncheon Loaf
John Nagamichi Cho (1998)


------=_NextPart_000_0038_01BFB065.21867A70
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2919.6307" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D375061923-27042000>Hi everyone,</SPAN></DIV>
<DIV><SPAN class=3D375061923-27042000></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D375061923-27042000>I've got another text file =
question and was=20
hoping I could glean more knowledge...</SPAN></DIV>
<DIV><SPAN class=3D375061923-27042000></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D375061923-27042000>Problem:</SPAN></DIV>
<DIV><SPAN class=3D375061923-27042000>Over a hundred text files by the =
following=20
file name convention:</SPAN></DIV>
<DIV><SPAN class=3D375061923-27042000></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D375061923-27042000>quickYYYYMMDD.txt</SPAN></DIV>
<DIV><SPAN class=3D375061923-27042000></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D375061923-27042000>For each file, read the&nbsp;1st =
and 7th=20
line, and then write those lines to another file named aggy.txt in the =
following=20
format:</SPAN></DIV>
<DIV><SPAN class=3D375061923-27042000></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D375061923-27042000>&lt;1st line&gt;, "~", &lt;7th=20
line&gt;</SPAN></DIV>
<DIV><SPAN class=3D375061923-27042000></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D375061923-27042000>Any help or suggestions on how to =
go about=20
doing this would be greatly appreciated.&nbsp; As it stands, I'm opening =
each=20
file copy/pasting the lines.</SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV align=3Dleft><FONT face=3DTahoma size=3D2>John Choi</FONT></DIV>
<DIV align=3Dleft><FONT face=3DTahoma size=3D2>(415) =
845-9072</FONT></DIV>
<DIV align=3Dleft>&nbsp;</DIV>
<DIV align=3Dleft><FONT face=3D"Century Gothic"=20
size=3D2>----------------------------------------------------------------=
--</FONT></DIV>
<DIV align=3Dleft><FONT face=3DTahoma>
<DIV align=3Dleft><FONT face=3DTahoma>
<DIV align=3Dleft><FONT face=3D"Century Gothic" size=3D2><SPAN=20
class=3D984272520-25032000></SPAN></FONT></DIV>
<DIV align=3Dleft><FONT size=3D1></FONT></DIV>
<DIV align=3Dleft><FONT face=3DVerdana>Shooting star of =
SPAM,</FONT></DIV>
<DIV align=3Dleft><FONT face=3DVerdana>Tail like a greasy white =
plume,</FONT></DIV>
<DIV align=3Dleft><FONT face=3DVerdana>Gastonomical.</FONT></DIV>
<DIV align=3Dleft><SPAN class=3D984272520-25032000></SPAN></FONT><FONT=20
face=3D"Century Gothic"=20
size=3D2>----------------------------------------------------------------=
--</FONT></DIV></DIV>
<DIV align=3Dleft><FONT size=3D2>Spam-ku:&nbsp; Tranquil Reflections on =
Luncheon=20
Loaf</FONT></DIV>
<DIV align=3Dleft><FONT size=3D2>John Nagamichi Cho =
(1998)</FONT></DIV></FONT></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_0038_01BFB065.21867A70--