FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » input a section of a large file
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
input a section of a large file [message #171656] Fri, 14 January 2011 17:41 Go to next message
richard is currently offline  richard   
Messages: 213
Registered: June 2013
Karma: 0
Senior Member
Just being curious.
Is it possible in php to acquire information from a file in part, rather
than retrieving the whole file?
I have a series of tables that I would prefer not showing up on the main
page when loaded. When the user clicks the link, the tables would appear.
Rather than uploading a thousand small files, I'd rather upload a dozen or
so files and retrieive the tables as needed.

http://1littleworld.net/tables1.html

Just a rough draft to show what I'm talking about. I know there is no
character encoding so don't be bitching about it not validating.
Re: input a section of a large file [message #171657 is a reply to message #171656] Fri, 14 January 2011 18:00 Go to previous messageGo to next message
Adrienne Boswell is currently offline  Adrienne Boswell
Messages: 25
Registered: October 2010
Karma: 0
Junior Member
Gazing into my crystal ball I observed richard <member(at)newsguy(dot)com>
writing in news:1d4pessmkmgis$(dot)dlg(at)evanplatt(dot)sux:

> Just being curious.
> Is it possible in php to acquire information from a file in part,
> rather than retrieving the whole file?
> I have a series of tables that I would prefer not showing up on the
> main page when loaded. When the user clicks the link, the tables would
> appear. Rather than uploading a thousand small files, I'd rather
> upload a dozen or so files and retrieive the tables as needed.
>
> http://1littleworld.net/tables1.html
>
> Just a rough draft to show what I'm talking about. I know there is no
> character encoding so don't be bitching about it not validating.
>

SELECT fields FROM table WHERE condition ORDER BY field LIMIT number

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Re: input a section of a large file [message #171658 is a reply to message #171657] Fri, 14 January 2011 18:15 Go to previous messageGo to next message
richard is currently offline  richard   
Messages: 213
Registered: June 2013
Karma: 0
Senior Member
On Fri, 14 Jan 2011 18:00:08 +0000 (UTC), Adrienne Boswell wrote:

> Gazing into my crystal ball I observed richard <member(at)newsguy(dot)com>
> writing in news:1d4pessmkmgis$(dot)dlg(at)evanplatt(dot)sux:
>
>> Just being curious.
>> Is it possible in php to acquire information from a file in part,
>> rather than retrieving the whole file?
>> I have a series of tables that I would prefer not showing up on the
>> main page when loaded. When the user clicks the link, the tables would
>> appear. Rather than uploading a thousand small files, I'd rather
>> upload a dozen or so files and retrieive the tables as needed.
>>
>> http://1littleworld.net/tables1.html
>>
>> Just a rough draft to show what I'm talking about. I know there is no
>> character encoding so don't be bitching about it not validating.
>>
>
> SELECT fields FROM table WHERE condition ORDER BY field LIMIT number

Is this from mysql? Did I say I wanted to use mysql?
Re: input a section of a large file [message #171659 is a reply to message #171656] Fri, 14 January 2011 18:25 Go to previous messageGo to next message
richard is currently offline  richard   
Messages: 213
Registered: June 2013
Karma: 0
Senior Member
On Fri, 14 Jan 2011 10:41:19 -0700, richard wrote:

> Just being curious.
> Is it possible in php to acquire information from a file in part, rather
> than retrieving the whole file?
> I have a series of tables that I would prefer not showing up on the main
> page when loaded. When the user clicks the link, the tables would appear.
> Rather than uploading a thousand small files, I'd rather upload a dozen or
> so files and retrieive the tables as needed.
>
> http://1littleworld.net/tables1.html
>
> Just a rough draft to show what I'm talking about. I know there is no
> character encoding so don't be bitching about it not validating.

Perhaps to clarify a little, I am thinking of something in the way of using
file_get_contents as a means to open the file, then retrieving the
particular item I want within that file.
Re: input a section of a large file [message #171661 is a reply to message #171659] Fri, 14 January 2011 19:01 Go to previous messageGo to next message
Luuk is currently offline  Luuk
Messages: 329
Registered: September 2010
Karma: 0
Senior Member
On 14-01-11 19:25, richard wrote:
> On Fri, 14 Jan 2011 10:41:19 -0700, richard wrote:
>
>> Just being curious.
>> Is it possible in php to acquire information from a file in part, rather
>> than retrieving the whole file?
>> I have a series of tables that I would prefer not showing up on the main
>> page when loaded. When the user clicks the link, the tables would appear.
>> Rather than uploading a thousand small files, I'd rather upload a dozen or
>> so files and retrieive the tables as needed.
>>
>> http://1littleworld.net/tables1.html
>>
>> Just a rough draft to show what I'm talking about. I know there is no
>> character encoding so don't be bitching about it not validating.
>
> Perhaps to clarify a little, I am thinking of something in the way of using
> file_get_contents as a means to open the file, then retrieving the
> particular item I want within that file.

yes, its possible,
but its also pissoble for a mouse,
to stamp on a bridge, and say to the elephant next to him,
we're doing great aren't we....

It would me much easier to do things in MySQL if you want this
or, a a second option, to store the data in different files,
But WHY all date in 1 large file?????

--
Luuk
Re: input a section of a large file [message #171662 is a reply to message #171659] Fri, 14 January 2011 19:31 Go to previous messageGo to next message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma: 0
Senior Member
On 14/01/11 18:25, richard wrote:
> On Fri, 14 Jan 2011 10:41:19 -0700, richard wrote:
>
>> Just being curious.
>> Is it possible in php to acquire information from a file in part, rather
>> than retrieving the whole file?

Yes, you can read a line at a time.

>> I have a series of tables that I would prefer not showing up on the main
>> page when loaded. When the user clicks the link, the tables would appear.
>> Rather than uploading a thousand small files, I'd rather upload a dozen or
>> so files and retrieive the tables as needed.

If you want to use text files that contain data (for example csv data)
that you will use to create tables, it would probably be best to have a
separate file containing the data for each table that you wish to create.

You could also write a script off-line to create html tables that are
output as included php files. This would save the resources involved in
repeated conversion to html using php of static data in text files.

> Perhaps to clarify a little, I am thinking of something in the way of using
> file_get_contents as a means to open the file, then retrieving the
> particular item I want within that file.

If a file contains data for lots of tables, how will you know where in
the file the data for the table that you want is?

Where are you going to store the offsets? And what implications does
that have for things that need to get updated when the table data files
are changed?

What happens when you discover that all your offsets are wrong due to
differences in cr/lf handling?

Rgds

Denis McMahon
Re: input a section of a large file [message #171671 is a reply to message #171658] Sat, 15 January 2011 04:00 Go to previous messageGo to next message
Adrienne Boswell is currently offline  Adrienne Boswell
Messages: 25
Registered: October 2010
Karma: 0
Junior Member
Gazing into my crystal ball I observed richard <member(at)newsguy(dot)com>
writing in news:j3opbqdcvvac$(dot)dlg(at)evanplatt(dot)sux:

> On Fri, 14 Jan 2011 18:00:08 +0000 (UTC), Adrienne Boswell wrote:
>
>> Gazing into my crystal ball I observed richard <member(at)newsguy(dot)com>
>> writing in news:1d4pessmkmgis$(dot)dlg(at)evanplatt(dot)sux:
>>
>>> Just being curious.
>>> Is it possible in php to acquire information from a file in part,
>>> rather than retrieving the whole file?
>>> I have a series of tables that I would prefer not showing up on the
>>> main page when loaded. When the user clicks the link, the tables
>>> would appear. Rather than uploading a thousand small files, I'd
>>> rather upload a dozen or so files and retrieive the tables as
>>> needed.
>>>
>>> http://1littleworld.net/tables1.html
>>>
>>> Just a rough draft to show what I'm talking about. I know there is
>>> no character encoding so don't be bitching about it not validating.
>>>
>>
>> SELECT fields FROM table WHERE condition ORDER BY field LIMIT number
>
> Is this from mysql? Did I say I wanted to use mysql?

As others have said in this and previous threads, MySQL is the best tool
for the job. Yes, you can walk from Los Angeles to San Franisco, but
it's a heck of a lot faster and easier to fly.

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Re: input a section of a large file [message #171672 is a reply to message #171671] Sat, 15 January 2011 04:28 Go to previous messageGo to next message
Sherm Pendley is currently offline  Sherm Pendley
Messages: 33
Registered: September 2010
Karma: 0
Member
Adrienne Boswell <arbpen(at)yahoo(dot)com> writes:

> As others have said in this and previous threads, MySQL is the best tool
> for the job. Yes, you can walk from Los Angeles to San Franisco, but
> it's a heck of a lot faster and easier to fly.

Good advice, but poor example... These days it might actually be easier
to walk. :-)

sherm--

--
Sherm Pendley
<http://camelbones.sourceforge.net>
Cocoa Developer
Re: input a section of a large file [message #171673 is a reply to message #171672] Sat, 15 January 2011 04:37 Go to previous messageGo to next message
Adrienne Boswell is currently offline  Adrienne Boswell
Messages: 25
Registered: October 2010
Karma: 0
Junior Member
Gazing into my crystal ball I observed Sherm Pendley
<sherm(dot)pendley(at)gmail(dot)com> writing in
news:m2ei8e94f6(dot)fsf(at)sherm(dot)shermpendley(dot)com:

> Adrienne Boswell <arbpen(at)yahoo(dot)com> writes:
>
>> As others have said in this and previous threads, MySQL is the best
>> tool for the job. Yes, you can walk from Los Angeles to San
>> Franisco, but it's a heck of a lot faster and easier to fly.
>
> Good advice, but poor example... These days it might actually be
> easier to walk. :-)
>

Actually, I prefer taking the train. I have flown into Oakland airport
many times, and each time, it looked like the plane was going to land in
the water. Finally, I decided it was just too stressful for me, and I
really like trains. I even take my son, and friends, to National Train
Day at Union Station every year.

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Re: input a section of a large file [message #171674 is a reply to message #171658] Sat, 15 January 2011 04:42 Go to previous messageGo to next message
Evan Platt is currently offline  Evan Platt
Messages: 124
Registered: November 2010
Karma: 0
Senior Member
On Fri, 14 Jan 2011 11:15:52 -0700, richard <member(at)newsguy(dot)com>
wrote:

> Is this from mysql?

No, it's a SQL statement.

> Did I say I wanted to use mysql?

No, but you didn't say you didn't want to.

Damn, is the word thank you not in your vocabulary, idiot?

PS: Still waiting for you to explain "As my server is using windows,
..htaccess is kind of useless for me anyway."

But don't worry, we all know you have no answer for that.
--
To reply via e-mail, remove The Obvious and .invalid from my e-mail address.
Re: input a section of a large file [message #171675 is a reply to message #171674] Sat, 15 January 2011 06:38 Go to previous messageGo to next message
richard is currently offline  richard   
Messages: 213
Registered: June 2013
Karma: 0
Senior Member
You really have your damn nerve trying to show off your intelligence when
your own website is a pathetic excuse.
You haven't done a damn thing with it in two years.
Re: input a section of a large file [message #171676 is a reply to message #171675] Sat, 15 January 2011 07:16 Go to previous messageGo to next message
Michael Vilain is currently offline  Michael Vilain
Messages: 88
Registered: September 2010
Karma: 0
Member
In article <z4p872ushoz5$(dot)dlg(at)evanplatt(dot)sux>,
richard <member(at)newsguy(dot)com> wrote:

> You really have your damn nerve trying to show off your intelligence when
> your own website is a pathetic excuse.
> You haven't done a damn thing with it in two years.

Doesn't excuse being gracious with free help. Guess manners weren't
something taught in your household. Your mother should be ashamed of
herself for raising you this way.

--
DeeDee, don't press that button! DeeDee! NO! Dee...
[I filter all Goggle Groups posts, so any reply may be automatically ignored]
Re: input a section of a large file [message #171677 is a reply to message #171676] Sat, 15 January 2011 08:02 Go to previous messageGo to next message
richard is currently offline  richard   
Messages: 213
Registered: June 2013
Karma: 0
Senior Member
On Fri, 14 Jan 2011 23:16:25 -0800, Michael Vilain wrote:

> In article <z4p872ushoz5$(dot)dlg(at)evanplatt(dot)sux>,
> richard <member(at)newsguy(dot)com> wrote:
>
>> You really have your damn nerve trying to show off your intelligence when
>> your own website is a pathetic excuse.
>> You haven't done a damn thing with it in two years.
>
> Doesn't excuse being gracious with free help. Guess manners weren't
> something taught in your household. Your mother should be ashamed of
> herself for raising you this way.

explain that to mr. platt. For better than two years he's been harassing me
over any little thing he cares too. so when I harass back, I'm the one who
gets their ass chewed out. He is a stalker and a nutcase, pure and simple.
Re: input a section of a large file [message #171678 is a reply to message #171658] Sat, 15 January 2011 12:35 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
richard wrote:
> On Fri, 14 Jan 2011 18:00:08 +0000 (UTC), Adrienne Boswell wrote:
>
>> Gazing into my crystal ball I observed richard <member(at)newsguy(dot)com>
>> writing in news:1d4pessmkmgis$(dot)dlg(at)evanplatt(dot)sux:
>>
>>> Just being curious.
>>> Is it possible in php to acquire information from a file in part,
>>> rather than retrieving the whole file?
>>> I have a series of tables that I would prefer not showing up on the
>>> main page when loaded. When the user clicks the link, the tables would
>>> appear. Rather than uploading a thousand small files, I'd rather
>>> upload a dozen or so files and retrieive the tables as needed.
>>>
>>> http://1littleworld.net/tables1.html
>>>
>>> Just a rough draft to show what I'm talking about. I know there is no
>>> character encoding so don't be bitching about it not validating.
>>>
>> SELECT fields FROM table WHERE condition ORDER BY field LIMIT number
>
> Is this from mysql? Did I say I wanted to use mysql?

Otherwise fopen,..fseek..fread(n)..fclose..?
Re: input a section of a large file [message #171680 is a reply to message #171677] Sat, 15 January 2011 13:43 Go to previous messageGo to next message
spambait is currently offline  spambait
Messages: 35
Registered: September 2010
Karma: 0
Member
In article <u0206lyvndu3(dot)dlg(at)evanplatt(dot)sux>, richard <member(at)newsguy(dot)com> wrote:
> On Fri, 14 Jan 2011 23:16:25 -0800, Michael Vilain wrote:
>
>> In article <z4p872ushoz5$(dot)dlg(at)evanplatt(dot)sux>,
>> richard <member(at)newsguy(dot)com> wrote:
>>
>>> You really have your damn nerve trying to show off your intelligence when
>>> your own website is a pathetic excuse.
>>> You haven't done a damn thing with it in two years.
>>
>> Doesn't excuse being gracious with free help. Guess manners weren't
>> something taught in your household. Your mother should be ashamed of
>> herself for raising you this way.
>
> explain that to mr. platt. For better than two years he's been harassing me
> over any little thing he cares too. so when I harass back, I'm the one who
> gets their ass chewed out. He is a stalker and a nutcase, pure and simple.

One of the things he "harasses" you about is your persistent ingratitude for
all of the free help you receive. Would it kill you to *ask* for help, instead
of demanding it? Would it kill you to say "please" and "thank you" once in a
while? Would it kill you to accept the help you're given graciously, without
arguing with and abusing those who offer it? Your failure to engage, *ever*,
in these common courtesies makes you look like a prick.
Re: input a section of a large file [message #171681 is a reply to message #171675] Sat, 15 January 2011 15:54 Go to previous messageGo to next message
Evan Platt is currently offline  Evan Platt
Messages: 124
Registered: November 2010
Karma: 0
Senior Member
On Fri, 14 Jan 2011 23:38:12 -0700, richard <member(at)newsguy(dot)com>
wrote:

> You really have your damn nerve trying to show off your intelligence when
> your own website is a pathetic excuse.

You are a pathetic excuse for a human being.

> You haven't done a damn thing with it in two years.

Uhh yes, I have. The photos section is updated quite regularly.

PS: Still waiting for you to explain "As my server is using windows,
..htaccess is kind of useless for me anyway."

Yeah you neglected to quote that in your reply.
--
To reply via e-mail, remove The Obvious and .invalid from my e-mail address.
Re: input a section of a large file [message #171682 is a reply to message #171677] Sat, 15 January 2011 15:55 Go to previous messageGo to next message
Evan Platt is currently offline  Evan Platt
Messages: 124
Registered: November 2010
Karma: 0
Senior Member
On Sat, 15 Jan 2011 01:02:31 -0700, richard <member(at)newsguy(dot)com>
wrote:

> explain that to mr. platt. For better than two years he's been harassing me
> over any little thing he cares too.

No, I CORRECT you when you make a totally incorrect statement.

> so when I harass back, I'm the one who gets their ass chewed out.

Yep.

> He is a stalker and a nutcase, pure and simple.

I'm a stalker and a nutcase? You're the idiot who posted my home and
work address to usenet groups, and even threatened to come to my work
and house and kick my ass.

Who's the stalker, bullshit bullis?

No, I don't expect you have the balls to reply.
--
To reply via e-mail, remove The Obvious and .invalid from my e-mail address.
Re: input a section of a large file [message #171683 is a reply to message #171673] Sat, 15 January 2011 16:10 Go to previous message
Sherm Pendley is currently offline  Sherm Pendley
Messages: 33
Registered: September 2010
Karma: 0
Member
Adrienne Boswell <arbpen(at)yahoo(dot)com> writes:

> Gazing into my crystal ball I observed Sherm Pendley
> <sherm(dot)pendley(at)gmail(dot)com> writing in
> news:m2ei8e94f6(dot)fsf(at)sherm(dot)shermpendley(dot)com:
>
>> Adrienne Boswell <arbpen(at)yahoo(dot)com> writes:
>>
>>> As others have said in this and previous threads, MySQL is the best
>>> tool for the job. Yes, you can walk from Los Angeles to San
>>> Franisco, but it's a heck of a lot faster and easier to fly.
>>
>> Good advice, but poor example... These days it might actually be
>> easier to walk. :-)
>
> Actually, I prefer taking the train.

I intend to do just that next time I travel. It may take a bit longer,
but it's a far more pleasant experience - *especially* given the new
security measures at airports.

> I have flown into Oakland airport
> many times, and each time, it looked like the plane was going to land in
> the water.

The approach into Boston's Logan airport is pretty much the same kind
of experience.

sherm--

--
Sherm Pendley
<http://camelbones.sourceforge.net>
Cocoa Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: php xml DOM/xpath how to reference child nodes by name within foreach loop?
Next Topic: Adaptive Learning for PHP
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 07:43:17 GMT 2024

Total time taken to generate the page: 0.02758 seconds