Jump to content
Sign in to follow this  
ddoberloh

Pulling an IP out of a file

Recommended Posts

ddoberloh

So i have a file that contains all kinds of information about a network adapter formattes something like this

[stuff1]

this is some stuff

this is stuff too = 12345

this is more

[stuff2]

this is some stuff

this is more = <WHAT I NEED>

more more etc...

...

...

end of file

how would i go about extracting this to a variable in auto it?

Share this post


Link to post
Share on other sites
somdcomputerguy

Maybe this'll work for you. In the example, $var is the second this is more, and [stuff2] is section2.

IniRead

Edited by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites
UEZ

Show a real example how your file looks like.

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
Skitty

You're probably dealing with what they call an ini file. There are script functions to get information from those.

try looking into IniRead("SomeStuff","default data")


Things that I've done..

Icon Resource Editor: icon resource editor 

AutoIt Piano: a piano

AutoIt Unlocker: unlocks files when you want to delete them

Colorful tooltips: a wrapper for the tool tips UDF

Rouge GoogleBot: a full screen animation

ASciTE text editor: a text editor written in autoit

Warning: Posts by this user are subject to change or may disappear without notice.

Share this post


Link to post
Share on other sites
ddoberloh

[gateway]

activationkey = 0006306948189422573245

type = standalone

[loader]

application_1 = Gateway.exe

application_2 = Client.exe

application_3 = discovery-server.exe

application_4 = discovery-responder.exe

[sslconf]

clientkeypath = mycert

[attributes]

customerid = 112

networkpassword = 3497398556403941

gwid = 630

gwuser = Gateway@company.com

gwpassword = wxn4tx2bx7jrjn

[TunnelServer]

primarysubnet = 2001:5470:214b:0120::

ptunaddress = 2001:0470:818b:0501::0120:0002

secondarysubnet = 2001:0470:8135:0121::

ptunsubnet = 2071:9470:813b:0001::0120

ptunsubnetmask = 112

primarysubnetmask = 64

secondarysubnetmask = 64

tunnelservertcpport = 50494

tunnelserveripv4address = 143.155.782.209

slash48address = 2001:0470:813b:

cint = Wireless Network Connection

This is what my file looks like. What i need is in red. The file is a special file called a .gateway file but it opens normally as a text file.

Share this post


Link to post
Share on other sites
ddoberloh

HEY!!! I ran it through the IniRead file and BAM worked perfectly! Thanks for all the input guys.

Share this post


Link to post
Share on other sites
somdcomputerguy

Glad you got it worked out. Good luck with the rest of your project! ;)


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites
Mechaflash

ZOMG FREE PASSWORDS!

All your bases are belong to GUESTS

Edited by mechaflash213
  • Like 1

Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

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  

×