Jago6060 Posted July 17, 2009 Share Posted July 17, 2009 I have a file with exchange rates in it. The file was obtained via wget from a website so there is a lot of extra junk that I don't need. My first step in my project(well, step 1b) is to get rid of the extra info and replace the tabs with commas. Some help getting started would be greatly appreciated. If any more info is needed, just ask. Link to comment https://forums.phpfreaks.com/topic/166361-solved-need-help-parsing-a-file/ Share on other sites More sharing options...
ldougherty Posted July 17, 2009 Share Posted July 17, 2009 There would be a couple different ways logically to do this. You can either retain the existing document and remove the crap you don't want. Or you can find the stuff you do want from the document and grab it to store it in another document. I personally would probably use file_get_contents to return the file data into a string and then use the php string functions to use what you want and replace what you dont. http://us2.php.net/manual/en/function.file-get-contents.php http://us2.php.net/manual/en/ref.strings.php Link to comment https://forums.phpfreaks.com/topic/166361-solved-need-help-parsing-a-file/#findComment-877268 Share on other sites More sharing options...
Jago6060 Posted July 20, 2009 Author Share Posted July 20, 2009 Not exactly solved, but the project lead and I decided what we were trying to do wasn't worth the effort compared to the effort involved with a manual copy and paste. Link to comment https://forums.phpfreaks.com/topic/166361-solved-need-help-parsing-a-file/#findComment-878617 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.