Sign in to follow this  
Followers 0
Keniger

Delete text from specific marker.

5 posts in this topic

#1 ·  Posted (edited)

I have example :

"

<th scope='col' class='col_f_post'>Ostatni post</th>

</tr>
<!-- BEGIN TOPICS -->


<tr itemscope itemtype="[url="http://schema.org/Article"]http://schema.org/Article"[/url] class='__topic  expandable' id='trow_718292' data-tid="718292">
<td class='col_f_icon altrow short'>

"

I want delete all data before <!-- BEGIN TOPICS -->

To get only this :

<!-- BEGIN TOPICS -->


<tr itemscope itemtype="[url="http://schema.org/Article"]http://schema.org/Article"[/url] class='__topic  expandable' id='trow_718292' data-tid="718292">
<td class='col_f_icon altrow short'>

Is that possible to do ?

Edited by Keniger

Share this post


Link to post
Share on other sites



Of course, put the text you posted in a txt file named "1.txt" and run this

Msgbox(0,"", StringRegExpReplace(FileRead("1.txt"), '(?s).+<!-- BEGIN TOPICS -->.+)', "$1") )

Share this post


Link to post
Share on other sites

And if you want to do it to the webpage itself - you can use IE.Au3 library to read the table HTML - perform the same replace statement as per mikell's post and put the result back.

Share this post


Link to post
Share on other sites

Hum for this InetRead is better (and faster) than the _IEBodyReadHtml()

Share this post


Link to post
Share on other sites

mikell,

Perhaps you meant this

Msgbox(0,"", StringRegExpReplace(FileRead("1.txt"), '(?s).+(<!-- BEGIN TOPICS -->.+)', "$1") )

* - opening paren for capturing group mising

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0