LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   split up text file (https://www.linuxquestions.org/questions/programming-9/split-up-text-file-332233/)

jollyjoice 06-10-2005 11:52 AM

split up text file
 
Ok, very simple. I just want to split the output of uptime into several text files so I can add in some line breaks on my site. The idea is to show current uptime local time etc. for the server but the formatting is naff, just a single line of text. I have the following cronjob
Code:

uptime > /webstuff/uptime.txt
and a php file, using
Code:

<?php require("uptime.txt"); ?></p>
Apart from breaking apart the text file - how would i do that? - and adding in <br> between the require commands how can i auto format this?

Any ideas appreciated. Thanks J.

acid_kewpie 06-10-2005 01:09 PM

if i may say so, that's a daft way to get your uptime.... ;) there's loads of better ways to wrap around it, not least but just calling the command directly... why bother with a cron job?? also just read /proc/uptime, don't redirect a console utility to a file anyway.

if you'd look for details on google, you'll be hit with hundreds of suitable examples http://www.google.com/search?q=php+uptime

jollyjoice 06-10-2005 01:30 PM

well i also want to do it with the F@H unit info file, and yeh i know its a bit stupid but heh, I'm only playing about.

acid_kewpie 06-10-2005 01:44 PM

F@H?

jollyjoice 06-10-2005 03:33 PM

Folding @ Home


All times are GMT -5. The time now is 07:30 AM.