coolheadash Posted September 2, 2008 Share Posted September 2, 2008 Hi. I have used perl to generate a text file in some defined format. Now, I want this file to be displayed neatly in tabular form in a html page which would be quite helpful.. I understand that i need to use php for that, but I am totally new to it. Can someone help? My text file looks like: xyz.tic Passed : 187 Failed : 0 Timeout : 0 Crashed : 0 Total : 187 #################################### abc.tic Passed : 24 Failed : 1 Timeout : 0 Crashed : 0 Total : 25 #################################### and so on. in the end there is a summation of all the cases.. I want it in a html page which shows up data next to *.tic file in one line: like: *.tic: passed failed timeout crashed total ....................................................... ....................................................... and so on... Thanks. Quote Link to comment Share on other sites More sharing options...
lemmin Posted September 2, 2008 Share Posted September 2, 2008 You can use regex to replace text formatting with html formatting. This will format for tabs and new lines: <?php echo preg_replace(array("/\t/", "/\n/"), array(" ", "<br>"), file_get_contents("file.txt")); ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.