Jump to content
Sign in to follow this  
bhargavik

Substring

Recommended Posts

bhargavik

hi friends 

Local $sub='SMBus'
Local $tit ='ID - Notepad'

Local $va=WinGetText($tit)
MsgBox(0, "ControlGetText Example", "The control text is: " & $va)

This is my code ..From the file . i need to get the SMbus substring alone . Please help me friend... I attach the ID.txt

ID.au3

Share this post


Link to post
Share on other sites
trancexx

Well, you use $tit, but maybe you should go with more than one, make array that you can call $tits and loop through the $tits until you get what you want. You might check For...In.

I actually downloaded your attachment. Cool.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
bhargavik

we have any other function to get the substring from a text . I took the first line from the file . from this i need to get SMBus . 

Local $sub='SMBus'
Local $tit1 ='ID - Notepad'

Local $va1=WinGetText($tit1)
MsgBox(0, "ControlGetText Example", "The control text is: " & $va1)


Local $days = StringSplit($va1, "-")
MsgBox(0, "Array", "text" & $days[1])
Edited by bhargavik

Share this post


Link to post
Share on other sites
JLogan3o13

make array that you can call $tits and loop through the $tits until you get what you want.

 

Just curious if you knew what you were writing, or if this was truly unintentional :)


√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
trancexx

Just curious if you knew what you were writing, or if this was truly unintentional :)

What? I should've used indefinite article before the "array"? I'm non-English speaker, sometimes it's hard to decide about correct grammar.

What do you think if I knew? :)


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
0xdefea7

 

What? I should've used indefinite article before the "array"? I'm non-English speaker, sometimes it's hard to decide about correct grammar.

 

What do you think if I knew?  :)

 

The word "Tit" is slang in English for female breast, which makes this line rather funny (though correct):

 

Well, you use $tit, but maybe you should go with more than one, make array that you can call $tits and loop through the $tits until you get what you want. You might check For...In.

Share this post


Link to post
Share on other sites
JohnQSmith

It's a bird. http://en.wikipedia.org/wiki/Tit_(bird)

Get your minds out of the gutter.


Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

Share this post


Link to post
Share on other sites
jchd

Now comes the Parus familly!

I'm a hobbyist birdwatcher. And I bet my keyboard that trancexx knows enough slang to have been fully aware of the humour she plugged in her post.

To be honest, I'd be bitterly disappointed if it was not humour.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites
kylomas

I actually downloaded your attachment. Cool.

 

This is some serious "tongue in cheek" shit...damn near as funny as the tit thing!!!

@bhargavik - If you are processing a file there is no need to use Notepad.  Try the following.  See the comments in the code to see what the file looks like.  The attachment that you posted is not a TXT file.  It is another version of your script.

;
;

#include <array.au3>

local $file_string = fileread(@scriptdir & '\id.txt')
local $aTits = stringregexp($file_string,'SMBus - (.*?)\R',3)
_arraydisplay($aTits)


; @scriptdir \id.txt looks like:
;
;   line 1
;   line 2
;   line 3
;   SMBus - the text that I want to capture
;   line 5
;   line 6
;   line 7

kylomas

Edited by 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
trancexx

The word "Tit" is slang in English for female breast, which makes this line rather funny (though correct):

Uhm... I'm fucking with you. Of course it was joke :). But thanks for the linguistic input.

 

I also like how kylomas picked up on another one. I like that one better because it's not so obvious, you have to really feel it to get it. Don't tell anyone ( :shhh:), but sometimes I make myself laugh. And sometimes I make only myself laugh, which I guess isn't very good :ermm: .


♡♡♡

.

eMyvnE

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  

×