Jump to content

Substring


Recommended Posts

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
Link to comment
Share on other sites

  • Moderators

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 :)

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

 

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.
Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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...