How to create a tab delimitted text file?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have converted .xls file to .txt using TransferText method
But my text file is a comma delimitted file(A mess).
I want to make it tab delimitted.
How should I do this?

THis is my code:

'converted to an text file
DoCmd.TransferText acExportDelim, TableName:="Sheet1",
fileName:="\\melapp01\CCC\Data\ACT\Customers\" & XLSfileName & ".txt",
hasfieldnames:=True

newTextFileName = XLSfileName & ".txt"
' newCSVFileName = Replace(XLSfileName, ".xls", ".csv")

filePath = "\\melapp01\CCC\Data\ACT\Customers\" & newTextFileName
loadDate = Format(DateValue(Me.txtLoadDate), "dd/mm/yyyy")

strSQL = "EXEC sp_BulkLoad '" & filePath & "','" & loadDate & "'"
 
If you use an Export Spec, you can specfiy the field delimiter.

After starting the Export Text wizard, click the Advanced button, which lets
you define and save the spec.
 
Back
Top