View Single Post
Old 2009-02-13, 12:35 PM   #5
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
upload the following and your file to be converted as filename.txt:

Code:
<?php
  $contents = file_get_contents("filename.txt");
  $line_by_line = explode("\n", $contents);
  array_pop($line_by_line); // get rid of the empty line at the end that explode creates
  $results = array();

  foreach ($line_by_line as $line) {
    list ($url, $title, $description) = explode("|", $line);
    print "$title|$url|$description\n";
  }
?>
The php version will output the result from your screen so that you can cut and paste it into whatever.

alternatively if you have ssh access, you could do:

Code:
awk < filename.txt -F\| '{ print $2 "|" $1 "|" $3 }' > outfile.txt
and end up with the result in outfile.txt which could be downloaded.
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote