Jump to content

How Do I Extract Specific Text?


Recommended Posts

I have a txt file that i need certain info extracted from it and paste into another txt file. I've attached the file . In the file therein contain "Top Searches in the last 7 days", "Category:" , "Location:" and keywords . They looks like this below.

Top Searches in the last 7 days

Category: Telecommunications

Location: United States

verizon

iphone

blackberry

att

verizon wireless

at&t

twitter

sprint

tmobile

comcast

The info I'm looking to extract the ............

verizon

iphone

blackberry

att

verizon wireless

at&t

twitter

sprint

tmobile

comcast

I'll be using this function on many documents. Be mindful that I'm looking for a function that when ever it sees ...... Top Searches in the last 7 days

Category:

Location: United States

Any keywords after "Location:United States " and before "View full report" get extracted and placed in the a txt file of my choice. Could some one help me out ?

iGoogle.txt

Link to comment
Share on other sites

_StringBetween is what you need. Also look at fileread if you haven't already.

You say I need these two functions?

#Include <string.au3>
_StringBetween($sString, $sStart, $sEnd[, $vCase = -1[, $iSRE = -1]])

FileRead ( filehandle or "filename" [, count] )

How can I bring them together in order to do the work I need to be done? Should I code it like this?

]#Include <string.au3>
_StringBetween(;Right here the strings are all different.   , "Location: United States", "View full report")
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...