[thelist] How to split a long text file into separate files

Oren Levin lists at pinetree.net
Mon Oct 15 13:49:19 CDT 2001


run the file through Perl and change the end of line value to 2 returns ($/
= "\n\n") a la:

$/ = "\n\n";
while(<>) {
  # do something with the table here
}

-----Original Message-----
From: thelist-admin at lists.evolt.org
[mailto:thelist-admin at lists.evolt.org]On Behalf Of Michael Barrett
Sent: Monday, October 15, 2001 2:43 PM
To: thelist at lists.evolt.org
Subject: [thelist] How to split a long text file into separate files


Listers,

I have this long text file,
The result of a mail merge from an excel document.

The data in the excel doc needs to be made available on a web site. There is
no server side scripting available.

I created a neat and clean table layout to hold the data, brought the html
into word, then merged with the data in the excel doc to produce a long
document with 69 tables, then saved as text.

I want each table in a separate file.

Short of an afternoon of copying and pasting, is there a handy way to
(automated) way to hack the document into parts? Possibly using emacs or
something similar?

Each table is proceeded by a comment tag, and followed by two line breaks
like so...

<!--Record Number:1-->
<table>
Foo
</table>
<br>
<br>

Thoughts?

--
Michael Barrett
-O^O-
  -

mbarrett at triad.rr.com
AIM: device55


---------------------------------------
For unsubscribe and other options, including
the Tip Harvester and archive of TheList go to:
http://lists.evolt.org Workers of the Web, evolt !





More information about the thelist mailing list