 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
ahk_noob Guest
|
Posted: Tue Mar 16, 2010 5:50 am Post subject: trying to use StringSplit |
|
|
Hi all..
I was trying to use stringsplit command to a particular file name.
like for example
I wish to rename this file but I have to keep the extension..
i tried using split path to store .doc into a variable.. but seems like it doesnt work for me..
I tried this:
| Code: | name=i am a newbie.doc
stringsplit,word_array,name,.,
|
i tried to display out the word_array but seems like it doesn work. I got to display out word by word. for example word_array4.
May I know how can I save the .doc into a variable?
thanks for the help as i am really new to AHK.. |
|
| Back to top |
|
 |
None
Joined: 28 Nov 2009 Posts: 3086
|
Posted: Tue Mar 16, 2010 5:58 am Post subject: |
|
|
Try This
| Code: | Name=i am a newbie.doc
Ext:= SubStr(Name,-3)
MsgBox %Ext% |
|
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 8688
|
Posted: Tue Mar 16, 2010 6:08 am Post subject: |
|
|
You may use SplitPath command:
| Code: | InputVar = i am a newbie.doc
SplitPath, InputVar, OutFileName, OutDir, OutExtension, OutNameNoExt, OutDrive
MsgBox, % OutNameNoExt "`n" OutExtension
|
|
|
| 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
|