|
Joined: Aug 2000
Posts: 469
Member
|
Member
Joined: Aug 2000
Posts: 469 |
I'm trying to put together a script that opens a text file with some info in it (seperated by "|"'s), and prints out all that info. Here is what I have so far, but it doesn't work. I don't have an error, but it just doesn't work. And if you're wondering, this is not how the whole thing is going to work, I just wanted to see if the opening/printing of the file would work. As an end result, I'd like to rename all the review files with numbers, then have &intro list them all, only using titles inside the file instead (much like how forumdisplay works, I think). But for right now I'd be happy to see this simple thing work. Any suggestions? ------------------ -david Choose your future. www.antipopculture.org
|
|
|
|
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
|
P.I.T.A. / Programmer
Joined: Sep 2000
Posts: 755 |
@reviewdata = split(/|/, @data); $writer = $data[0]; $email = $data[1]; $creator = $data[2]; $title = $data[3]; $type = $data[4]; $review = $data[5];
you should be assigning those from $reviewdata[] not data.
At any rate, it's much better to just right
my ($write, $email, $creator, $title, $type, $review) = split(/|/, @data);
"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
|
|
|
|
Joined: Aug 2000
Posts: 469
Member
|
Member
Joined: Aug 2000
Posts: 469 |
well thats interesting. OK, I changed data to review data, and re-ran the script. I also renamed the file that is opened 000000.txt, but I don't think that has anything to do with...anything. Anyway, I re-ran the script and the only thing it did different was print out "1" for $writer. Then, I changed the script using the code you provided, and this time it printed out "0" (thats a zero) for $writer. I'm purplexed. http://www.antipopculture.org/reviews/review.cgi ------------------ -david Choose your future. www.antipopculture.org This message has been edited by evil-empire on November 01, 2000 at 04:36 PM
|
|
|
|
Joined: Aug 2000
Posts: 469
Member
|
Member
Joined: Aug 2000
Posts: 469 |
OK, zanardi helped me with all those problems. Well, the functional ones. New problem though. When the script prints the $review variable, it only prints whats on the first line of the file. So, if I have: as the review, only "Nsync are horrible, they suck so much." is printed. suggestions? ------------------ -david Choose your future. www.antipopculture.org
|
|
|
|
Joined: Aug 2000
Posts: 3,590
Moderator
|
Moderator
Joined: Aug 2000
Posts: 3,590 |
Is don't buy thier album! in a second line? If so, and you are trying to read line by line, the second line won't be read. ------------------ Da Wannabe Cannuck:: Who is Andy?
|
|
|
|
Joined: Aug 2000
Posts: 469
Member
|
Member
Joined: Aug 2000
Posts: 469 |
yeah...thats what I was trying to say. Now how do I fix that problem? I need it to read off of multiple lines, since all of the reviews will have multiple paragraphs. ------------------ -david www.antipopculture.org Who's in bunker, who's in bunker? Women and children first Women and children first
|
|
|
|
Joined: Aug 2000
Posts: 335
Member
|
Member
Joined: Aug 2000
Posts: 335 |
Try replacing: with this: This message has been edited by Dave_L on November 03, 2000 at 11:50 AM
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 70
Joined: January 2007
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|