AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Extract text into var

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
nomissenrojb



Joined: 08 Nov 2009
Posts: 42

PostPosted: Wed Dec 02, 2009 7:47 am    Post subject: Extract text into var Reply with quote

If i have lines like this
Var1=drwxr-x--- 2 10052ftp System 0 Nov 30 18:44 FORD_004171
Var2=drwxr-x--- 2 10052ftp System 0 Nov 30 18:43 TUR_0000861271

How do i extract only "FORD_004171" and "TUR_0000861271" from that?

Basically remove drwxr-x--- 2 10052ftp System 0 Nov 30 18:44

Thanks
Back to top
View user's profile Send private message
Guest






PostPosted: Wed Dec 02, 2009 7:59 am    Post subject: Reply with quote

Code:
Var1=drwxr-x--- 2 10052ftp System 0 Nov 30 18:44 FORD_004171
Var2=drwxr-x--- 2 10052ftp System 0 Nov 30 18:43 TUR_0000861271
StringMid, this1, var1, 45, 20
StringMid, this2, var2, 45, 20
msgbox, %this1% %this2%
Back to top
hd0202



Joined: 13 Aug 2006
Posts: 265
Location: Germany

PostPosted: Wed Dec 02, 2009 8:05 am    Post subject: Reply with quote

Code:
stringgetpos, pos, var1, %a_space%, R
var1_new := substr(var1, pos + 1)

Hubert
Back to top
View user's profile Send private message
nomissenrojb



Joined: 08 Nov 2009
Posts: 42

PostPosted: Wed Dec 02, 2009 8:07 am    Post subject: Reply with quote

Quote:
Var1=drwxr-x--- 2 10052ftp System 0 Nov 30 18:44 FORD_004171
Var2=drwxr-x--- 2 10052ftp System 0 Nov 30 18:43 TUR_0000861271
StringMid, this1, var1, 45, 20
StringMid, this2, var2, 45, 20
msgbox, %this1% %this2%


What if the line next time is
Var1=drwxr-x--- 2 10052ftp System 0 Nov 3 8:44 FORD_004171
And not
Var1=drwxr-x--- 2 10052ftp System 0 Nov 30 18:44 FORD_004171
Back to top
View user's profile Send private message
nomissenrojb



Joined: 08 Nov 2009
Posts: 42

PostPosted: Wed Dec 02, 2009 8:10 am    Post subject: Reply with quote

hd0202 wrote:
Code:
stringgetpos, pos, var1, %a_space%, R
var1_new := substr(var1, pos + 1)

Hubert


Thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group