Php text file zeilenweise einlesen




















July 6, at pm. July 17, at pm. Rohit Durgapal says:. July 24, at am. October 30, at am. Kalzec says:. October 30, at pm. June 13, at pm. Akhil says:. August 20, at pm. Leave a Reply Cancel reply Your email address will not be published. Copy file from one directory to another directory in PHP ».

Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website. Dateien lesen Weiter: Dateien schreiben. OK Weitere Infos. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website.

We also use third-party cookies that help us analyze and understand how you use this website. Viewed 56k times. Any ideas how to handle this? Improve this question. Add a comment. Active Oldest Votes. Improve this answer. MikeSchinkel 4, 4 4 gold badges 34 34 silver badges 44 44 bronze badges. I came to similar solution. I read the file and search for tab in it; if not found I assume that the delimiter is comma.

Then use getscv as version of php is 5. Although I see some flaws in this, I can't think of anything better. Perhaps count the tabs and commas and other potential delimiters on the first line, then compare them to the second line and so on. Whichever is most consistent is your likely delimiter. A two pass solution, unfortunately, but that's often the way when you have such an unknown. You can specify a delimiter for fgetcsv.

Yes, but it can be also a csv file. The problem is how to tell for sure if it is csv or tab delemited. Here is an example that will read mydata. Barry 3, 7 7 gold badges 21 21 silver badges 42 42 bronze badges.

Jignesh Prajapati Jignesh Prajapati 96 1 1 silver badge 4 4 bronze badges. Read the whole file, or line by line and split it using split. But that method would eliminate the enclosure functionality of getcsv, likely defeating the purpose of all but the simplest of csv files.



0コメント

  • 1000 / 1000