Page 1 of 1

how to split the text file???

Posted: Tue Jun 14, 2005 11:02 am
by kanchan
i have a text file... which is of very heavy size.... do u guys have any tools to extract the text in easy way????

Posted: Tue Jun 14, 2005 11:08 am
by infolock
quick and diry that will parse a text file and split it up based on comma-delimited and space delimited ...

Code: Select all

$file_contents = file('styletest.css');
foreach ($file_contents as $num => $line_data) 
{
  $line_no = $num + 1; 
  $parsed_data = preg_split("/[\s,]+/", $line_data);
  //do something...
}