Results 1 to 8 of 8

 

Thread: txt to html

  1. #1
    Keith's Avatar
    Moderator

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Richmond North Yorkshire
    Posts
    2,540
    Thanks
    172
    Thanked 119 Times in 83 Posts


    Anyone know of a utilty or script for converting txt files to html?
    Keith ~ My Blog general ramblings. Internet Marketing Blogs UK all the blogs together in one place (pm for inclusion)

  2. #2
    Avoiding real work

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Buckinghamshire
    Posts
    1,373
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Not quite sure I understand what you mean Keith.

    Do you mean that you've got a text file that you want to put HTML Tags into or does the TXT file already have the tags?
    Those who can do, those who can't talk about it

  3. #3
    Keith's Avatar
    Moderator

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Richmond North Yorkshire
    Posts
    2,540
    Thanks
    172
    Thanked 119 Times in 83 Posts
    just wanted to put in the <br> tags for now, anyway been playing since my first post and have come up with this

    PHP Code:
    <?

    // txt - html
    $file_name "file.txt";

    $result file($file_name);


    $arrayLength count($result);
      foreach (
    $result as $html){
      
    $html str_replace("\\\", "", $html);
      $html = str_replace("
    n", "<br>", $html);

               echo "
    $html";
      }

    ?>
    which does what I need for now.

    thanks
    Keith ~ My Blog general ramblings. Internet Marketing Blogs UK all the blogs together in one place (pm for inclusion)

  4. #4
    Registered User

    Status
    Offline
    Join Date
    Aug 2003
    Location
    HUDDERSFIELD, UK
    Posts
    750
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi

    I use a free Perl script to convert Text to HTML, available
    here http://willmaster.com/possibilities/...20409001.shtml

    (You now have to subscribe to the newsletter to get
    this free script. I'm a subscriber, and find it a useful
    Perl/CGI resource.)

    Basically, the script adds <br> or <p></p> tags
    and Header tags if necessary, and it can make your
    links open in a new window or not. I find that it
    saves me a lot of time - I have a working version,
    that I use for myself (can show you if you PM me)

    As I said, the script is free from the Willmaster website -
    just become a subscriber of his newsletter first (which
    is of course, east to unsubscribe from)

    Cheers,
    Steve

  5. #5
    Keith's Avatar
    Moderator

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Richmond North Yorkshire
    Posts
    2,540
    Thanks
    172
    Thanked 119 Times in 83 Posts
    thanks Steve i've just subscribed.
    Keith ~ My Blog general ramblings. Internet Marketing Blogs UK all the blogs together in one place (pm for inclusion)

  6. #6
    Azam.net's Avatar
    Azam Marketing

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Bloomsbury, London
    Posts
    3,278
    Thanks
    211
    Thanked 71 Times in 52 Posts
    Word can also save txt files in HTML format. However, the code it produces is quite bloated.
    Azam Marketing

    Read Azam.info, the most regularly updated UK affiliate marketing blog - click here

  7. #7
    Keith's Avatar
    Moderator

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Richmond North Yorkshire
    Posts
    2,540
    Thanks
    172
    Thanked 119 Times in 83 Posts
    Originally posted by smnash
    Hi

    I use a free Perl script to convert Text to HTML, available
    here http://willmaster.com/possibilities/...20409001.shtml

    Just got access to this script today, what a great little program cheers m8
    Keith ~ My Blog general ramblings. Internet Marketing Blogs UK all the blogs together in one place (pm for inclusion)

  8. #8
    Registered User

    Status
    Offline
    Join Date
    Aug 2003
    Location
    HUDDERSFIELD, UK
    Posts
    750
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Just got access to this script today, what a great little program cheers m8
    Glad to be of help.

    Even better than the script, in my opinion, is the newsletter
    by Will and Mari Bontrager. I'm not really into CGI/Perl,
    JavaScript and the like, and I don't always read all of the
    newsletter, but I always find something useful (like how
    to start CRON tasks on a UNIX server, in one issue)

    So, are you going to advertise your script to the world, Keith?
    (I probably should ! It is a good lil' program, after all!)

    Steve



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
To Top

Content Relevant URLs by vBSEO 3.5.0 RC2