Forum Moderators: phranque

Message Too Old, No Replies

Batch convert text files into HTML...?

parsing text files to html

         

Skorp

12:49 am on Jun 10, 2005 (gmt 0)

10+ Year Member



I need to take about 150 text files and turn them into separate HTML files. I need the files to be named sequentially (page1.html, page2.html, etc.). I also need each HTML file to have certain fields (like I want to insert code for random banners). It would also be cool, but not required, if it could let me add a random bit of code to each one.

What is the easiest way to do this? I would I guess be ok with something that does this locally on my computer. But a better solution would let me just upload the text files to my server, and have a script that parses them into what I want. If it is a server-side solution, then I don't care about the file names. I'm ok with [mydomain.com...] or whatever.

Anyone?
thanks

disgust

6:48 am on Jun 10, 2005 (gmt 0)

10+ Year Member



download a file renamer. name all the text files sequencially (0001.txt, 0002.txt, etc)

make a simple php script to

1) grab the get var from the url
2) include the file associated with the get var