Greenguy's Board


Go Back   Greenguy's Board > General Business Knowledge
Register FAQ Calendar Today's Posts

 
 
Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
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
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:50 PM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc