Need function to process tab delimited file using associative array
| From: | Eric Wood | Date: | Mon, 25 Oct 2004 02:22:41 +0000 |
| Subject: | Need function to process tab delimited file using associative array | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-200208@lists.php.net to get a copy of this message | ||
Does anyone have a function stored away that can selectively let me trim out
only the columns *by name* I need from a delimited text file?
For Example:
FName<tab>LName<tab>Phone
John<tab>Smith<tab>3433335335
James<tab>Smith<tab>2345223533
Judy<tab>Smith<tab>5474574544
The first line wouldmake the associative array list names from the title
row, and rows 2 onward are the data. So that I can:
read row 1 into array
print 'FName','LName'
for each row
print_r('FName')."\t".print_r('Phone').'\n';
next row
This would allow me to ignore all the other colums I don't need and just
save the ones I do need.
Thanks,
-Eric Wood