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?
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)
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
just wanted to put in the <br> tags for now, anyway been playing since my first post and have come up with this
which does what I need for now.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";
}
?>
thanks
Keith ~ My Blog general ramblings. Internet Marketing Blogs UK all the blogs together in one place (pm for inclusion)
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
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)
Word can also save txt files in HTML format. However, the code it produces is quite bloated.
Just got access to this script today, what a great little program cheers m8Originally posted by smnash
Hi
I use a free Perl script to convert Text to HTML, available
here http://willmaster.com/possibilities/...20409001.shtml
Keith ~ My Blog general ramblings. Internet Marketing Blogs UK all the blogs together in one place (pm for inclusion)
Glad to be of help.Just got access to this script today, what a great little program cheers m8
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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks