Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Non delimited text export using docmd.tranfer

Status
Not open for further replies.

bscs1963

Programmer
Apr 7, 2009
22
US

I placed this in the wrong forum, so here it goes again.

I have a table with unique lines that have 'pipes' as the delimiter already built into the fields.Now I want to export the table to a text file without delimiters.

I can not use a specification becase I must have something for a delimiter.How can I simply export the data to a txt to csv file without an delimiter.
 
I am not sure if I understand, but I think I would build a query and wrap the fields in a function to remove the pipes.

Code:
Public Function remPipes(varVal As Variant) As Variant
  If Not IsNull(varVal) Then
    remPipes = Replace(varVal, "|", " ")
  End If
End Function

Then in a query something like
Select remPipes(fieldOne) as NewFieldOne, remPipes(fieldTwo) as NewFieldTwo....
 
From what I can see, you can use delimiters in specifications... if you build it correctly...

When you import the first one, there is an option for Other, and a box for you to put the delimiter that you want... just use the pipe '|' in that box, then it will use it as the delimiter.

Then, before you actually import the file, save the Specification using the Advanced button... then you can use that specification in the code.

GComyn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top