How to create a tab delimitted text file?

R

raj

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 & "'"
 
A

Allen Browne

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top