Jump to content

Retrieve Data from Text file


nirvana

Recommended Posts

Hi All,

I was wondering if someone can help me with this.

I am trying to retrieve data from text file - and the location (the path) of that text file is saved in mySQL database.
I am wondering if there is a way of retrieving that data.
Sorry I am new to PHP and I have done a few queries to retrieve data from database but would like to know if the above approach is feasible.

thanks in advance,
nirvana
Link to comment
Share on other sites

[!--quoteo(post=380889:date=Jun 7 2006, 01:50 AM:name=Prismatic)--][div class=\'quotetop\']QUOTE(Prismatic @ Jun 7 2006, 01:50 AM) [snapback]380889[/snapback][/div][div class=\'quotemain\'][!--quotec--]
It is very possible :) What format is the text file? Post the contents of it, or a sample, so we can help you out a little bit better :)
[/quote]

Hi,

The text file is comma delimited and here is the sample:

1,191.400,-45.8,0
1,191.405,-44.6,0
1,191.410,-40.6,0
2,191.500,-50.5,0
2,191.505,-48.2,0
2,191.510,-45.3,0

some text files contain more than 4 columns and they are the data of channel, frequency, loss, attenuation etc.

thanks,
nirvana
Link to comment
Share on other sites

[!--quoteo(post=380949:date=Jun 7 2006, 06:37 AM:name=nirvana)--][div class=\'quotetop\']QUOTE(nirvana @ Jun 7 2006, 06:37 AM) [snapback]380949[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Hi,

The text file is comma delimited and here is the sample:

1,191.400,-45.8,0
1,191.405,-44.6,0
1,191.410,-40.6,0
2,191.500,-50.5,0
2,191.505,-48.2,0
2,191.510,-45.3,0

some text files contain more than 4 columns and they are the data of channel, frequency, loss, attenuation etc.

thanks,
nirvana
[/quote]


Forgot to mention one more thing. I am going to use these data to plot the graphs using JpGraph. I wrote a program to plot the graphs using php and jpgraph but the data were retrieved from database directly. Now the data location has changed and they are saved as text file and need to access those files in order to plot the graphs.

thanks,
nirvana
Link to comment
Share on other sites

You can use explode() or split() functions:

[a href=\"http://www.php.net/explode\" target=\"_blank\"]http://www.php.net/explode[/a]
[a href=\"http://www.php.net/split\" target=\"_blank\"]http://www.php.net/split[/a]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.