Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old September 1st, 2000, 01:31 AM
wazza wazza is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Brisbane,Q,Au
Posts: 16 wazza User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi everyone,

What i need to do is get the results from a flatfile.

While only displaying 10 results at a time. And a next button or maybe search feature to view the rest.

heres how the flatfile is done
$field1|$field2|$fields3|$field4

I need to be ale to print how may records are in the file.

And to return 10 results at a time.

Any ideas,
Wazza

Reply With Quote
  #2  
Old September 1st, 2000, 03:42 AM
christucker2 christucker2 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Posts: 81 christucker2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Best bet, if the file isn't too huge, is to just dump the entire file into a big ol' array (if the file is <10k in size, this approach will be fine -- bigger than that you might want to look at how the file is used to see where optimisations could be made). Use the following to get your records into a list:

<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
my @records = ();
open FH, 'filename';
while( <FH> )
{
push @records, split /|/;
}
[/code]


Reply With Quote
  #3  
Old September 1st, 2000, 04:36 AM
wazza wazza is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Brisbane,Q,Au
Posts: 16 wazza User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
What i actually need to do is have a number display at the top of the page telling me how many records are in the particular file.

And returning 10 results at a time. With a next 10 results link.

This is the last thing i need to work out for this particular script. Hopefully i can find the answer here.

Thanks for the reply,

Wazza

Reply With Quote
  #4  
Old September 1st, 2000, 06:02 AM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
>>Hopefully i can find the answer here

I am sure alot of people here know how to do it including me. I am not trying to be selfish but I don't want to post my codes here with nothing in return.

The best I can offer is to give you a link to download particular script that can do what you requested, then you are on your own to figure it out. If you don't understand some of the codes after spending your time and of course, with effort, then feel free to post it here.

Here is the link -> http://www.dcscripts.com/
and get 'dcguest' script.

Reply With Quote
  #5  
Old September 1st, 2000, 06:10 AM
wazza wazza is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Brisbane,Q,Au
Posts: 16 wazza User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks mate,

Thats exactly what im after. Never even thought about looking at a guest book script

Thanks again,
wazza

Reply With Quote
  #6  
Old September 1st, 2000, 09:10 PM
wazza wazza is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Brisbane,Q,Au
Posts: 16 wazza User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
removed

[This message has been edited by wazza (edited September 06, 2000).]

Reply With Quote
  #7  
Old September 3rd, 2000, 07:17 PM
wazza wazza is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Brisbane,Q,Au
Posts: 16 wazza User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
.

Reply With Quote
  #8  
Old September 6th, 2000, 01:43 AM
wazza wazza is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Brisbane,Q,Au
Posts: 16 wazza User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
never mind ill figure it out

Reply With Quote
  #9  
Old September 6th, 2000, 08:42 AM
turbobri turbobri is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Location: Tampa, FL, US
Posts: 7 turbobri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by freebsd:
>>I am not trying to be selfish but I don't want to post my codes here with nothing in return.
[/quote]

What you get in return is that someday, someone might share code with YOU when you get stuck...

Reply With Quote
  #10  
Old September 6th, 2000, 12:21 PM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
There is no free lunch in the world. Especially in a public forum like this. If he is struggling, he can always hire someone to do it for him. If you are really that kind, why don't you post your codes and help him out then? Futher, I already posted a link to solve his exact problem if he still can't figure it out, he is on his own as I mentioned.

>>someone might share code with YOU when you get stuck...

Yeah. What if I get stuck, I would do some searching on the net to find an answer and solve it on my own. But so far that hasn't happened to me that often.

Reply With Quote
  #11  
Old September 7th, 2000, 05:01 AM
kudinov kudinov is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 19 kudinov User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by turbobri:
What you get in return is that someday, someone might share code with YOU when you get stuck...[/quote]

Are you about the not documentary possibilities and the closed program codes of Microsoft? (Joke)


Reply With Quote
  #12  
Old September 7th, 2000, 05:24 AM
wazza wazza is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Brisbane,Q,Au
Posts: 16 wazza User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Come on guys dont` stress.

I ended up getting it all working. So its all Good

Cheers.
Wazza

Reply With Quote
  #13  
Old September 12th, 2000, 04:44 AM
raghuramb raghuramb is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Chennai,TamilNadu,India
Posts: 33 raghuramb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Wazza, did you find any answer for your flat file question, coz i didnt find any answer there in the forum, only arguments between the members.

Raghu.

Reply With Quote
  #14  
Old September 13th, 2000, 01:35 AM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
>>coz i didnt find any answer there in the forum

As I said, read the link I posted in this thread. Read my 1st reply above.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Results from a flatfile db?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway