LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-03-2012, 08:50 AM   #1
exallon
LQ Newbie
 
Registered: Feb 2007
Posts: 17

Rep: Reputation: 0
Possible to read just from a certain point in HTML document (logfile)


Hi

I am trying to find a way to read only the end of a txt file appended to by a webserver.

assume http://somesite.com/myfile.txt

data1
data2
..
data10

read full file

server adds data
Data x
Data y

I then want to continue from after data10 to minimize server load. Is there a way to do this?

Thanks!
 
Old 01-03-2012, 11:19 AM   #2
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Hi,

possible with awk, see examples from here
Code:
awk '/search_pattern/{f=1;next}f' file
or something like
Code:
cat /var/log/messages  | awk '/search_pattern/,0'
 
Old 01-05-2012, 02:23 AM   #3
exallon
LQ Newbie
 
Registered: Feb 2007
Posts: 17

Original Poster
Rep: Reputation: 0
I don't have direct access to that server. So what I need to make happen is to make the webserver only send me the data that is new.

Otherwise I might as well just get the whole file over and over again. But this is to minimize server load since the file is growing over the day.
 
Old 01-05-2012, 04:50 AM   #4
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
for that you will need a PHP or some script to get the file from server and show you only the lines you want.

I don't know if there is anything like that already on the internet,
because I assume that every time you want data from file, the last lines change so the search condition also changes from previous search.

Post a sample file with data to get more help (you can use pastebin and post a link to that file here.
 
  


Reply



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
Read from tty to logfile peacefulatom Programming 5 08-27-2011 04:22 PM
printing an html document mchoquette Linux - Newbie 5 11-24-2010 12:39 PM
Script to read active squid logfile and output results to html based on conditions squidusr Programming 8 03-16-2010 08:33 PM
html; character encoding per document tag, not whole document TheLinuxDuck Programming 0 08-14-2008 11:12 AM
Fooling a HTML document? eantoranz Programming 11 11-11-2004 07:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration