Jump to content

Read and modify the content of a txt file


spyros1234

Recommended Posts

Hello

I am trying to make a script that will read a .txt file and it will export the text that is written in the file in separate variables

I have upload the txt file www.istografos.com/gari/orders3.txt

I will try to describe the file but will be better if you have the time to open it.

 

The text is written in the same order in each txt file. The problem is the text length will be indefinable.

 

And something else the txt file is an export from a ERP system so I can’t modify the text. I have to deal it as it is.

 

If you have any idea please HELP

 

You can use file() or file_get_contents() to read the content of a text file into a variable. You can then loop through the data and assign it to individual variables with the explode() function.

 

Check the manual on how to use these functions.

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.