Jump to content

[SOLVED] need help parsing a file


Jago6060

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.