AutoHotkey Community

It is currently May 27th, 2012, 12:20 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Extract text into var
PostPosted: December 2nd, 2009, 8:47 am 
Offline

Joined: November 8th, 2009, 6:36 am
Posts: 67
Location: Denmark
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 2nd, 2009, 8:59 am 
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%


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 2nd, 2009, 9:05 am 
Offline

Joined: August 13th, 2006, 6:45 am
Posts: 355
Location: Germany
Code:
stringgetpos, pos, var1, %a_space%, R
var1_new := substr(var1, pos + 1)

Hubert


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 2nd, 2009, 9:07 am 
Offline

Joined: November 8th, 2009, 6:36 am
Posts: 67
Location: Denmark
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 2nd, 2009, 9:10 am 
Offline

Joined: November 8th, 2009, 6:36 am
Posts: 67
Location: Denmark
hd0202 wrote:
Code:
stringgetpos, pos, var1, %a_space%, R
var1_new := substr(var1, pos + 1)

Hubert


Thanks


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Leef_me, Pulover, rjgatito, XstatyK, Yahoo [Bot] and 22 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group