manipulating CSV files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  hi folks,
  
  I have a CSV file. Data is separated by ','. For example:
  -94.86524,42.059444,A,B,X
  -96.86524,42.059444,A,B,Y1
  -99.86524,42.059444,A,B,C1 

  I want to interactively insert the user_name (passed by a php variable)
into the first "field" to insert then on my DataBase. 

  Peter,-94.86524,42.059444,A,B,X
  Jan,-96.86524,42.059444,A,B,Y1
  ...
  I know there is a command (fwrite) to write, but I can't figure out how to
start with it... 
  Afet open csv, etc. I think I should first check when there is a "return"
(we change of file), then I add the "user_name" parameter and repeat it as
long as there is some record.  
  
  Any workaround or code doing something similar for a newbie in php,
please?
  Thanks,

   Pere
-- 
View this message in context: http://www.nabble.com/manipulating-CSV-files-tf4548721.html#a12980387
Sent from the PHP - General mailing list archive at Nabble.com.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux