|
-
Apr 16th, 2000, 06:01 PM
#1
Thread Starter
_______
I have a few hundre files with weird names.
ie. Trying To Find A Few Hundred Dollars
Special Things To Do If You Are Dead
I would like to convert the file names to
the first letter of each word.
ie. ttfafhd
sttdiyad
How do I manipulate the strfunction or whatever to do such a thing.
Thanks,
Wayne
-
Apr 16th, 2000, 07:09 PM
#2
Fanatic Member
The following code should do it for you. I am sure someone else out there has a better method, but this one works.
Code:
Dim myStr As String
Dim newStr As String
Dim i As Long
i = 1
myStr = "Example Showing How To Get The First Charcter In Each Word In A String"
myStr = Trim$(myStr)
'get the first character.
newStr = Mid$(myStr, 1, 1)
'loop while there is a space in the string
While i <> 0
i = InStr(i, myStr, " ")
If (i <> 0) Then
i = i + 1
newStr = newStr & Mid$(myStr, i, 1)
End If
Wend
MsgBox newStr
Iain, thats with an i by the way!
-
Apr 16th, 2000, 07:13 PM
#3
Fanatic Member
I think I've got a vague idea...
Well.I've never done anything like this before, but te very base code would go *something* like this:
Code:
Dim strAcronym() as String, strFinal as String, i as Integer
strFinal = ""
strAcronym = Split(thefilename, " ")
For i = 0 to UBound(strAcronym)
strFinal = strFinal & Chr(Asc(strAcronym(i)))
Next:
[newfilename] = strFinal
Hmmm. Well that's as far as I know how to go.
Hope I've helped.
Au revoir.
Me.
-
Apr 16th, 2000, 09:26 PM
#4
Thread Starter
_______
Thanks...should do the trick...I'll give it a whirl when I get home.
Wayne
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|