 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
nomissenrojb
Joined: 08 Nov 2009 Posts: 42
|
Posted: Wed Dec 02, 2009 7:47 am Post subject: Extract text into var |
|
|
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 |
|
 |
Guest
|
Posted: Wed Dec 02, 2009 7:59 am Post subject: |
|
|
| 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
|
Posted: Wed Dec 02, 2009 8:05 am Post subject: |
|
|
| Code: | stringgetpos, pos, var1, %a_space%, R
var1_new := substr(var1, pos + 1) |
Hubert |
|
| Back to top |
|
 |
nomissenrojb
Joined: 08 Nov 2009 Posts: 42
|
Posted: Wed Dec 02, 2009 8:07 am Post subject: |
|
|
| 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 |
|
 |
nomissenrojb
Joined: 08 Nov 2009 Posts: 42
|
Posted: Wed Dec 02, 2009 8:10 am Post subject: |
|
|
| hd0202 wrote: | | Code: | stringgetpos, pos, var1, %a_space%, R
var1_new := substr(var1, pos + 1) |
Hubert |
Thanks |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|