Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
ninel
Posting Yak Master
141 Posts |
Posted - 2006-08-04 : 09:35:12
|
I have the following path of a file:"L:\VoicenetSQL\Project\Tampa\Politic\AT0000\Test.csv"I need to pull out the folder name where the file resides. In this case I would need "AT0000".How can I use the Instr function to do this? Or can I use something else?Thanks,Ninel |
|
dfiala
Posting Yak Master
116 Posts |
Posted - 2006-08-04 : 09:41:48
|
I'd use splitDim Parts() as StringDim Path as String = "L:\VoicenetSQL\Project\Tampa\Politic\AT0000\Test.csv"Parts = Path.Split("\"c)'The folder will be the second to last partDim Folder as String = Parts(Parts.Length-2)Dean FialaVery Practical Software, IncNow with Blogging...http://www.vpsw.com/blogbabyMicrosoft MVP |
 |
|
ninel
Posting Yak Master
141 Posts |
Posted - 2006-08-04 : 10:03:45
|
Thank you so much. It worked. |
 |
|
|
|
|