
turkscripts
Deleted
Jun 29, 2000, 2:14 AM
Post #10 of 10
(8789 views)
|
Re: Script for running news articles...
[In reply to]
|
Can't Post
|
|
You have to use a separator for individual components. Suppose I select my separator as <!-- seperator --> Then your text becomes: New Jersey Wins Stanley Cup <!-- seperator --> June 10, 2000 <!-- seperator --> Sports: Hockey <!-- seperator --> hockey, new jersey, stanley cup <!-- seperator --> Last night the New Jersey Devils won the final game in the Stanely Cup playoffs against the Dallas Stars... Here is the code which splits this text into parts: <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> # read the text file to a variable undef $/; open(A,"a.txt"); $text = <A>; close(A); $/ = "\n"; #split is into parts ($Title, $Date, $Category, $Keywords, $Descrition, $Article) = split("\n<!-- seperator --> \n", $text); </pre><HR></BLOCKQUOTE> This is pretty much it. ------------------ Turk Scripts http://turkiyem.com/turkscripts/
|