Re: Converting tab delimited file to CSV

From: Date: Wed, 20 Feb 2008 21:50:16 +0000
Subject: Re: Converting tab delimited file to CSV
References: 1 2 3 4 5 6  Groups: php.general 
Request: Send a blank email to php-general+get-269749@lists.php.net to get a copy of this message
Back to my 'original' problem/question, if I '$f = fopen("$file", "r")' and 'while ($data = fgets($f))' on the above first format and do a $data = str_replace("\t",",",$data); the resulting file looks like the second example above when opened into Textpad but will not open into separate columns when opened with Excel.
Look up http://www.php.net/fgetcsv and pass "\t" as the field separator. -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.general (#269749) next »