Text files split

Creating a database with a list of TXT files in a directory

Page 1 of 1

2 Replies - 3964 Views - Last Post: 09 July 2009 - 12:40 AM Rate Topic: -----

#1 JosTheOne  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 08-July 09

Text files split

Post icon  Posted 08 July 2009 - 11:05 AM

Hi,

I have a directory with a list of text files and I would like to create a database with them. So I can do validation.

Here is an example of a couple of files.

BCDXC 5301 4018 5646 20090615 1451.TXT
BCVXS 5301 4018 5664 20090703 1344.TXT

There is different variables in the name of the files and I would like them to be represented seperately in the database.

The fields are;
Device name Version1 Version2 Version3 Date Time

I am able to load all of the files in a list but what should I do next ?

Split ? (What Syntax)

here is my code.

Private Sub Command1_Click()
	Dim strStartPath As String
	strStartPath = "C:\Getinfo" 'Sarting directory
	ListFolder strStartPath
End Sub

Private Sub ListFolder(sFolderPath As String)
	Dim FS As New FileSystemObject
	Dim FSfolder As Folder
	Dim File As File
	Dim Dname As String
	Dim V
	Dim i As Integer
	
	Set FSfolder = FS.GetFolder(sFolderPath)
	Text1.Text = ""
	For Each File In FSfolder.Files
		DoEvents
		Text1.Text = Text1.Text & File & vbCrLf
		'split(text1.text," ")
	Next File
	Set FSfolder = Nothing
End Sub


What should I do next ?

Thanks,

JosTheOne :blink:

Is This A Good Question/Topic? 0
  • +

Replies To: Text files split

#2 raziel_  Icon User is offline

  • Like a lollipop
  • member icon

Reputation: 469
  • View blog
  • Posts: 4,280
  • Joined: 25-March 09

Re: Text files split

Posted 08 July 2009 - 11:32 PM

am you wanto to split the text file one from another or the info in txt file? if you want to split a txt files one from another you can load them in listbox not a textbox

This post has been edited by NoBrain: 08 July 2009 - 11:33 PM

Was This Post Helpful? 0
  • +
  • -

#3 born2c0de  Icon User is offline

  • printf("I'm a %XR",195936478);
  • member icon

Reputation: 187
  • View blog
  • Posts: 4,673
  • Joined: 26-November 04

Re: Text files split

Posted 09 July 2009 - 12:40 AM

Please refrain from using FileSystemObject in VB6.
Use the built-in File Handling commands available.
Read this tutorial here on DIC.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1