Jump to content
Sign in to follow this  
styles3000

How Do I Extract Specific Text?

Recommended Posts

styles3000

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

Share this post


Link to post
Share on other sites
dantay9

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


[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post


Link to post
Share on other sites
styles3000

_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")

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.