Previous Thread
Next Thread
Print Thread
Rate Thread
#101659 11/07/2000 4:36 PM
Joined: Nov 2000
Posts: 5
Junior Member
Junior Member
Offline
Joined: Nov 2000
Posts: 5
Where would I find a script that, like the hack, Member List, parses a series of files (in this case txt) and outputs the result in a neatly organized table.

The text files it would parse would be similar in structure to the member files of the UBB, but the scenario in which the file is being used is not one involving a forum or registered .

This message has been edited by joellark on November 07, 2000 at 03:40 PM


d

d

d

d


d


g

vvvvv
Sponsored Links
#101660 11/07/2000 5:03 PM
Joined: May 2000
Posts: 243
Member
Member
Offline
Joined: May 2000
Posts: 243
Well you could do something like this:

#!/usr/bin/perl/
print "Content-type: html/textnn";

$filespath = "c:/program files/apache group/apache/htdocs/review/";

opendir(DIR, "$filespath") or die "Couldn't open directory";
@directory = readdir(DIR);
closedir(DIR);

@files = grep(/.txt/, @directory);

foreach $eachfile(@files) {
chomp($eachfile);

open(FILE,"$filespath/$eachfile");
@filedata = ;
close(FILE);
@file = split(/|/, $filedata[0]);

$file = "$file[0]|$file[5]|$file[2]|$eachfile|n";
push(@agianfiles,$file);
}

print <My files








topHTML

foreach $file(@agianfiles) {
chomp($file);
@eachdata = split(/|/, $file);

print qq~~;

}

print <
File Name:Data 1:Data 2:Data 3:
$eachdata[3]$eachdata[0]$eachdata[1]$eachdata[2]

botHTML

########

That opens a directory, gets all the .txt files, then opens them individualy gets out some feilds and pushes them into an array. Now we run the array with all the data through a loop to print it out.


------------------
ZCom Bulletin Boards - Open Source Bulletin Boards

#101661 11/07/2000 5:31 PM
Joined: Sep 2000
Posts: 138
Em8 Offline
Member
Member
Offline
Joined: Sep 2000
Posts: 138
Don't you have to be in a for loop, foreach loop, or a subroutine before you can use
Code
code:
?

#101662 11/07/2000 7:48 PM
Joined: Nov 2000
Posts: 5
Junior Member
Junior Member
Offline
Joined: Nov 2000
Posts: 5
Is this script supposed to work after I change the $filespath to the path to my files, because it doesn't. When I run the script a download windows pops up and when the download item is downloaded, the whole cgi script was downloaded


d

d

d

d


d


g

vvvvv
#101663 11/07/2000 10:47 PM
Joined: May 2000
Posts: 243
Member
Member
Offline
Joined: May 2000
Posts: 243
I put it on my HD and modified it just a tad. Try it agian [Linked Image]

------------------
ZCom Bulletin Boards - Open Source Bulletin Boards

Sponsored Links
#101664 11/08/2000 5:50 PM
Joined: Nov 2000
Posts: 5
Junior Member
Junior Member
Offline
Joined: Nov 2000
Posts: 5
I still recieve the same error as mentioned above.


d

d

d

d


d


g

vvvvv
#101665 11/08/2000 5:54 PM
Joined: May 2000
Posts: 243
Member
Member
Offline
Joined: May 2000
Posts: 243
I don't know what to tell you, it was working ok for me. Are you useing the right shebang?

------------------
ZCom Bulletin Boards - Open Source Bulletin Boards

#101666 11/08/2000 6:00 PM
Joined: Nov 2000
Posts: 5
Junior Member
Junior Member
Offline
Joined: Nov 2000
Posts: 5
Yeah.....when i run the script i get a blank page even though alll my text files are there....filespath points to the right place...and the text files are 20 lines long


d

d

d

d


d


g

vvvvv
#101667 11/08/2000 6:28 PM
Joined: May 2000
Posts: 243
Member
Member
Offline
Joined: May 2000
Posts: 243
Well, what kind of system are you running on. I was running on win32, I can install it on my server and see what happens. You mean your getting an ALL white page. Does it say "My files" at the top?

------------------
ZCom Bulletin Boards - Open Source Bulletin Boards

#101668 11/10/2000 11:29 PM
Joined: Nov 2000
Posts: 5
Junior Member
Junior Member
Offline
Joined: Nov 2000
Posts: 5
i am running on unix...i get the white page of frustration


d

d

d

d


d


g

vvvvv
Sponsored Links

Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,575
Posts293,931
Members13,823
Most Online6,139
Sep 21st, 2024
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
Gizmo 1
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)