Recommend this page to a friend! | Stumble It! | Bookmark in del.icio.us |
All requests | > | Read tab delimited text file and sort by columns | > | Request new recommendation | > | Featured requests | > | No recommendations | ||
by Michael Wassil - 1 year ago (2015-02-10) read and sort file by columns
0 | I need to read a tab delimited text file, display it as a table sorted by columns |
+1 | by JME Farm 140 - 7 months ago (2015-06-22) Comment The read() method in my class will read a tab/comma delimited file into a matrix, doesn't have a built in sorting feature, though. The method defaults to csv, but if you change the $_csvdelim_ variable, or include the customer delimiter as the third parameter, you can read any type of delimited file. So for example, you would need these three lines: include "DB.php"; $db = new DB(); print_r($db->read("delimited.txt", "csv", "\t")); The second parameter must be "csv" so the method knows it's dealing with delimited text. Hope that helps. |
Recommend package | |
|