RE: [PHP] Need function to process tab delimited file using associative array

From: Date: Mon, 25 Oct 2004 02:41:17 +0000
Subject: RE: [PHP] Need function to process tab delimited file using associative array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-200210@lists.php.net to get a copy of this message
-----Original Message----- From: Eric Wood [mailto:eric@interplas.com] Sent: Monday, October 25, 2004 7:53 AM To: php-general@lists.php.net Subject: [PHP] Need function to process tab delimited file using associative array 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 >>> Following two functions can be usefull in making such algo File() Explode(); Read about them Zareef Ahmed >>> -- ------------------------------------------------------------------------ -- Zareef Ahmed :: A PHP develoepr in Delhi ( India ) Homepage :: http://www.zasaifi.com --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.782 / Virus Database: 528 - Release Date: 10/22/2004

« previous php.general (#200210) next »