Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 27th, 2004, 03:35 PM
Registered User
Join Date: Feb 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Parse text files and save in sub directories

Hi, please help...

How can I create a function that parses multiple text file and after is done saves them in a sub directory.

So far I can identify the path of the files and if there is any text files available in the Path.

I am stuck in the parsing part, the parsing consist in taking a text file and get rid of the header files and saves them in a sub directory.

I appreciate your help in advance...


Have a nice day
Old February 28th, 2004, 05:14 AM
Authorized User
Join Date: Aug 2003
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts

How about:

'Create the subfolder
MKDir path & "subfolder" 'might have to be "\subfolder"

'Copy the file to the subfolder [File Copy Source,Destination]
File Copy Path & FileName, Path & "subfolder\" & FileName

'Delete the file in the original folder
Kill Path & FileName

To get All the filenames in a folder you can use this one:
Dim strFile as string

strFile = Dir$(Path)

do until strFile = ""
    'action here
    strFile = Dir

Hope it helps

Old March 1st, 2004, 09:32 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts

I would also look at using the File System Object library. You can read more about it in the online help file or MSDN.

Larry Asher

Similar Threads
Thread Thread Starter Forum Replies Last Post
display directories and files using only xsl/xml.. eteune XSLT 1 January 2nd, 2007 07:01 PM
checking directories for files Trojan_uk Classic ASP Basics 1 March 16th, 2004 10:27 AM
Including same files in different directories jeremy108 BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 August 8th, 2003 01:37 PM
Deleting directories and files ... DennisTh VB.NET 2002/2003 Basics 5 June 12th, 2003 02:30 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.