export to text: remove blank lines/empty rows

anski

Registered User.
Local time
Tomorrow, 04:11
Joined
Sep 5, 2009
Messages
93
i am exporting a union query to a text file. i expect the cursor to be at the end of my data. instead, when i open the text file, the cursor is 2 rows away from the last row (with data). the export creates blank rows. the blank rows cause an error when i upload the text file to another program.

what do i use to remove the blank lines/empty rows?
 
Make another query that uses the union query,
Remove blanks in this query.
Export this.
 
^the query does not have blank rows (or even blank fields).
 
Last edited:
Could you post an example database that have the problem you describe?
 
Open the union query in datasheet view and sort it on various columns. Eventually the empty rows will pop to the top.

Access does not create empty rows when you export. and "union" removes duplicates so that would remove all but one empty record anyway.

What code are you using for the export? Also post the union query SQL please.
 
SOLVED: Re: export to text: remove blank lines/empty rows

the union query does not have any blank rows. i use the transfertext command to export to csv or text. i found something that works for me. this deletes the last blank row (access creates 2 blank rows) but still leaves one blank row which is acceptable to the program that i upload the exported file to.

if Right(sTemp, 2) = Chr(13) & Chr(10) Then
sTemp = Left(sTemp, Len(sTemp) - 2)
 
There is something wrong with your data. Access does not create blank rows on export.
 

Users who are viewing this thread

Back
Top Bottom