Sponsored Content
Top Forums Shell Programming and Scripting Script to extract forum posts Post 302492647 by KidCactus on Tuesday 1st of February 2011 05:15:51 AM
Old 02-01-2011
Script to extract forum posts

What I have:

HTML Code:
thread_id=666&page=6666#666666">Post title 1</a><br><div style="padding:2px 0px 3px 0px;">Text from the post itself</div>

thread_id=666&page=6666#666666">Post title 2</a><br><div style="padding:2px 0px 3px 0px;">Text from the post itself</div>

thread_id=666&page=6666#666666">Post title 3</a><br><div style="padding:2px 0px 3px 0px;">Text from the post itself</div>
What I want as result:

Quote:
Post title 1

Text from the post itself

Post title 2

Text from the post itself

Post title 3

Text from the post itself
I assume there would be a quite easy way to do this with awk?
 

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to monitor forum

Hello. I am attempting to write a pretty complex script that monitors a forum and alerts me whenever a new post is made (this part of the script is done). I then want to have the script auto reply to the post with a predetermined message. The one catch here is this is a VERY popular forum. ... (0 Replies)
Discussion started by: yousillygoose
0 Replies

2. UNIX for Advanced & Expert Users

Help! SHELL or AWK script - only the masters of the forum will solve

Hello everybody! I have no experience with shell Programmer, but I need to compare 02 files. Txt and generate an output or a new file, after the comparisons. see: If the column 1 of file1 is equal to column 1 of file2, and column 3 of file2 contains the column 4 of file1, output: column1... (4 Replies)
Discussion started by: He2
4 Replies

3. UNIX for Dummies Questions & Answers

Script required (Example of a Bad Forum Subject)

A file contains the following data Name, Age, Sex, city, country abc, 20, m, tokyo, Japan def, 21, f, sydney, Australia ghd, 23, m, chicago, USA rww, 29, f, london, UK I need the city column to be replaced with XXX as follows Name, Age, Sex, city, country abc, 20, m, XXX, Japan... (8 Replies)
Discussion started by: vva
8 Replies

4. What is on Your Mind?

Forum Update: Disabled Home Page Forum Statistics for Guests (Not Registered)

Just a quick update; to speed up the forums, I have disabled the forum statistics on the home page for non registered users. No changes for registered users. (0 Replies)
Discussion started by: Neo
0 Replies

5. What is on Your Mind?

Mobile: Advanced Forum Statistics to Forum Home Page

For mobile users, I have just added a "first beta" Advanced Forum Statistics to the home page on mobile using CSS overflow:auto; so you can swipe if you need to see more. Google Search Console mobile usability says this page is "mobile friendly" so perhaps this will be useful for some of our... (12 Replies)
Discussion started by: Neo
12 Replies
DOMDOCUMENT.SAVEHTMLFILE(3)						 1					       DOMDOCUMENT.SAVEHTMLFILE(3)

DOMDocument::saveHTMLFile - Dumps the internal document into a file using HTML formatting

SYNOPSIS
public int DOMDocument::saveHTMLFile (string $filename) DESCRIPTION
Creates an HTML document from the DOM representation. This function is usually called after building a new dom document from scratch as in the example below. PARAMETERS
o $filename - The path to the saved HTML document. RETURN VALUES
Returns the number of bytes written or FALSE if an error occurred. EXAMPLES
Example #1 Saving a HTML tree into a file <?php $doc = new DOMDocument('1.0'); // we want a nice output $doc->formatOutput = true; $root = $doc->createElement('html'); $root = $doc->appendChild($root); $head = $doc->createElement('head'); $head = $root->appendChild($head); $title = $doc->createElement('title'); $title = $head->appendChild($title); $text = $doc->createTextNode('This is the title'); $text = $title->appendChild($text); echo 'Wrote: ' . $doc->saveHTMLFile("/tmp/test.html") . ' bytes'; // Wrote: 129 bytes ?> SEE ALSO
DOMDocument::saveHTML, DOMDocument::loadHTML, DOMDocument::loadHTMLFile. PHP Documentation Group DOMDOCUMENT.SAVEHTMLFILE(3)
All times are GMT -4. The time now is 09:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy