nirvana Posted June 7, 2006 Share Posted June 7, 2006 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 Quote Link to comment https://forums.phpfreaks.com/topic/11379-retrieve-data-from-text-file/ Share on other sites More sharing options...
Allen4172 Posted June 7, 2006 Share Posted June 7, 2006 Take a look at the fopen and fwrite commands. That should get you started in the right direction. Quote Link to comment https://forums.phpfreaks.com/topic/11379-retrieve-data-from-text-file/#findComment-42689 Share on other sites More sharing options...
Prismatic Posted June 7, 2006 Share Posted June 7, 2006 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 Link to comment https://forums.phpfreaks.com/topic/11379-retrieve-data-from-text-file/#findComment-42694 Share on other sites More sharing options...
nirvana Posted June 7, 2006 Author Share Posted June 7, 2006 [!--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,01,191.405,-44.6,01,191.410,-40.6,02,191.500,-50.5,02,191.505,-48.2,02,191.510,-45.3,0some text files contain more than 4 columns and they are the data of channel, frequency, loss, attenuation etc.thanks,nirvana Quote Link to comment https://forums.phpfreaks.com/topic/11379-retrieve-data-from-text-file/#findComment-42751 Share on other sites More sharing options...
nirvana Posted June 8, 2006 Author Share Posted June 8, 2006 [!--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,01,191.405,-44.6,01,191.410,-40.6,02,191.500,-50.5,02,191.505,-48.2,02,191.510,-45.3,0some 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 Quote Link to comment https://forums.phpfreaks.com/topic/11379-retrieve-data-from-text-file/#findComment-43047 Share on other sites More sharing options...
poirot Posted June 8, 2006 Share Posted June 8, 2006 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] Quote Link to comment https://forums.phpfreaks.com/topic/11379-retrieve-data-from-text-file/#findComment-43067 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.