J
Jose I. Avila
All,
I have a vb script that imports every file in a directory. The problem is
that the files are pipe(vertical bar) "|" delimited. I need to know how to
tell the docmd.transfertext line to use a "|".
Can anyone help me?
Thank you in advance for your help.
========================
Sub Import_Allura_Tbls()
Dim fs, FullPath,FC
Dim FileName As String ' file name
Dim TableName As String ' table name = file name without the .txt
Dim i As Integer
' Define text file
Set fs = CreateObject("Scripting.FileSystemObject")
FullPath = "Y:\data\Allura\u\staff\bin\Data\txt_data_files" ' 50+ text
files reside here.
Set Fol = fs.GetFolder(FullPath)
Set FC = Fol.Files
For Each fi In FC ' files in Files collection
FileName = fi ' fullpath & fi.ShortName
i = InStr(1, fi.Name, ".")
TableName = Left(fi.Name, i - 1)
'
DoCmd.TransferText acImportDelim, , "dbo_" & TableName, FileName
'<=== need help here
Next
End Sub
I have a vb script that imports every file in a directory. The problem is
that the files are pipe(vertical bar) "|" delimited. I need to know how to
tell the docmd.transfertext line to use a "|".
Can anyone help me?
Thank you in advance for your help.
========================
Sub Import_Allura_Tbls()
Dim fs, FullPath,FC
Dim FileName As String ' file name
Dim TableName As String ' table name = file name without the .txt
Dim i As Integer
' Define text file
Set fs = CreateObject("Scripting.FileSystemObject")
FullPath = "Y:\data\Allura\u\staff\bin\Data\txt_data_files" ' 50+ text
files reside here.
Set Fol = fs.GetFolder(FullPath)
Set FC = Fol.Files
For Each fi In FC ' files in Files collection
FileName = fi ' fullpath & fi.ShortName
i = InStr(1, fi.Name, ".")
TableName = Left(fi.Name, i - 1)
'
DoCmd.TransferText acImportDelim, , "dbo_" & TableName, FileName
'<=== need help here
Next
End Sub