Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old May 21st, 2007, 04:39 PM
trevi trevi is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Aug 2005
Posts: 537 trevi User rank is Corporal (100 - 500 Reputation Level)trevi User rank is Corporal (100 - 500 Reputation Level)trevi User rank is Corporal (100 - 500 Reputation Level)trevi User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 Days 11 h 28 m 25 sec
Reputation Power: 7
Extracting a file name - how to?

hi,
I have to work with over 100 files, each one has a different name. ( from a mainframe and the files correspond to user names) After I ftp the files to my desktop is there a Vb command that can do that for me? I hope this forum is appropriate for this question.

thanks-

Reply With Quote
  #2  
Old May 22nd, 2007, 05:21 AM
nofriends's Avatar
nofriends nofriends is offline
Senior Water Wizard
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Aug 2004
Location: Cape Town, RSA
Posts: 10,186 nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)  Folding Points: 112786 Folding Title: Super Ultimate Folder - Level 1Folding Points: 112786 Folding Title: Super Ultimate Folder - Level 1Folding Points: 112786 Folding Title: Super Ultimate Folder - Level 1Folding Points: 112786 Folding Title: Super Ultimate Folder - Level 1Folding Points: 112786 Folding Title: Super Ultimate Folder - Level 1Folding Points: 112786 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 2 Days 7 h 36 m 24 sec
Reputation Power: 699
well, once all the files are downloaded, you
can use something like this to work through all of them:
Code:
Dim oFs As New FileSystemObject
Dim oFolder As Folder
Dim oFile As File
Dim FullPath as string = "C:\Documents and Settings\%USER%\Desktop\Folder\"

If oFs.FolderExists(FullPath) Then
    Set oFolder = oFs.GetFolder(FullPath)
 
    For Each oFile In oFolder.Files
		'-- use oFile.Name to open the file and process 
    Next
End If

hope this helps
__________________
Look! Its a ShemZilla



Reply With Quote
  #3  
Old May 22nd, 2007, 12:30 PM
trevi trevi is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Aug 2005
Posts: 537 trevi User rank is Corporal (100 - 500 Reputation Level)trevi User rank is Corporal (100 - 500 Reputation Level)trevi User rank is Corporal (100 - 500 Reputation Level)trevi User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 Days 11 h 28 m 25 sec
Reputation Power: 7
Quote:
Originally Posted by nofriends
well, once all the files are downloaded, you
can use something like this to work through all of them:
Code:
Dim oFs As New FileSystemObject
Dim oFolder As Folder
Dim oFile As File
Dim FullPath as string = "C:\Documents and Settings\%USER%\Desktop\Folder\"

If oFs.FolderExists(FullPath) Then
    Set oFolder = oFs.GetFolder(FullPath)
 
    For Each oFile In oFolder.Files
		'-- use oFile.Name to open the file and process 
    Next
End If

hope this helps

Yes, thanks. It gives me a good start. ...

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Extracting a file name - how to?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT