LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 06-10-2005, 11:52 AM   #1
jollyjoice
Member
 
Registered: Aug 2003
Location: UK
Distribution: Gentoo 64
Posts: 383

Rep: Reputation: 30
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.
 
Old 06-10-2005, 01:09 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
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
 
Old 06-10-2005, 01:30 PM   #3
jollyjoice
Member
 
Registered: Aug 2003
Location: UK
Distribution: Gentoo 64
Posts: 383

Original Poster
Rep: Reputation: 30
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.
 
Old 06-10-2005, 01:44 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
F@H?
 
Old 06-10-2005, 03:33 PM   #5
jollyjoice
Member
 
Registered: Aug 2003
Location: UK
Distribution: Gentoo 64
Posts: 383

Original Poster
Rep: Reputation: 30
Folding @ Home
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mysqldump : Can I split the file up to 2GB max per file? Swakoo Linux - General 10 10-17-2005 04:13 AM
bash: split text file iluvatar Programming 4 08-22-2005 08:58 AM
split one file to two alaios Linux - General 1 05-19-2005 10:24 PM
how to split a file in linux irfanhab Linux - General 1 05-04-2005 09:35 PM
split file farkmischer Linux - Laptop and Netbook 3 11-28-2004 07:19 AM


All times are GMT -5. The time now is 08:41 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration