![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | How to extract sub-strings? How can I extract substrings from strings? Especially I am searching for methods to... 1.) extract a substring with a known start position until the unknown end of the source string 2.) extract the last 3 chars of a string of unknown length Thomas |
My System Specs![]() |
| | #2 (permalink) |
| | Re: How to extract sub-strings? Hi Thomas, Quote: > Especially I am searching for methods to... > > 1.) extract a substring with a known start position until the unknown end of the source string Here ia a little Testsctipt... Set oFSO = CreateObject("Scripting.FileSystemObject") Set oFolder = oFSO.GetFolder(".") For Each oFile In oFolder.Files sFilename = Left(oFile.Name, InStr(oFile.Name, ".") -1) sEndung = Mid(oFile.Name, InStr(oFile.Name, "."), _ Len(oFile.Name)- InStr(oFile.Name, ".")+1) sFilename = sFilename & "1" & sEndung If MsgBox("Datei """ & oFile.Name & """ wird in """ _ & sFilename & """ umbenannt.", _ 1, "Bestätigung") <> 1 _ Then WScript.Quit If Not oFSO.Fileexists(sFilename) Then oFSO.CopyFile oFile, sFilename End If Next Quote: > 2.) extract the last 3 chars of a string of unknown length > HTH Dirk |
My System Specs![]() |
| | #3 (permalink) |
| | Re: How to extract sub-strings? "Thomas Lebrecht" <t.lebrecht@xxxxxx> wrote in message news:49cddb29$0$31346$9b4e6d93@xxxxxx-online.net... Quote: > How can I extract substrings from strings? > > Especially I am searching for methods to... > > 1.) extract a substring with a known start position until the unknown end > of the source string > > 2.) extract the last 3 chars of a string of unknown length > > Thomas functions, with examples. |
My System Specs![]() |
| | #4 (permalink) |
| | Re: How to extract sub-strings? "Dirk Stegemann" <dsgrafik@xxxxxx> wrote in message news:u0WGgD4rJHA.5912@xxxxxx Quote: > Hi Thomas, > Quote: > > Especially I am searching for methods to... > > > > 1.) extract a substring with a known start position until the unknown Quote: > > var = Mid(string, 3, Len(string)- 3)+1) the end of the string by default. var = Mid(string, startposition) -- Todd Vargo (Post questions to group only. Remove "z" to email personal messages) |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| compare strings | VB Script | |||
| -f paramater in strings | PowerShell | |||
| Comparing strings - is it a bug? | PowerShell | |||
| Resource strings | PowerShell | |||
| extract vista I can extract vista from the iso file but can not ex | Vista General | |||