By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,662 Members | 1,790 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,662 IT Pros & Developers. It's quick & easy.

How do i stop a carraige return from being inclued in export file?

P: 33
Can any one advise on the following please;

I am exporting a table of data into a CSV file from a MS Access 97 Db. An extract of the export routine used is below;

Expand|Select|Wrap|Line Numbers
  1. DoCmd.TransferText acExportDelim, "EXPORT_MobileSpec", "qryEXPMessageCUSTMobile", "\\server_id\C$\FolderName\FileName.csv"
The resulting file has a carraige return on the very last record of data, so if i have 5 lines of data exported, the file actually contains 6 lines.

Appreciate any advice, tks.
Dec 7 '11 #1

✓ answered by Mihail

Just an idea:
Reopen the file (after transfer) and remove last character(s).

Share this Question
Share on Google+
5 Replies


Rabbit
Expert Mod 10K+
P: 12,324
That shouldn't cause any problems. Is the last carriage return causing a problem?
Dec 7 '11 #2

P: 33
Hi Rabbit,
The exported file is being processed by another application and because there is an additional blank line at the end of the file, it produces an error. Question is, how can i stop the carraige return being applied at the end of the last record of data? Cheers.
Dec 8 '11 #3

100+
P: 759
Just an idea:
Reopen the file (after transfer) and remove last character(s).
Dec 8 '11 #4

NeoPa
Expert Mod 15k+
P: 31,271
If there is only one carriage return at the end of the file then that is how it should be.

If there is more than one then this would indicate you have a blank line in the data you're exporting.

If the former is true, then the software that is interpreting this file is either doing a poor job (and should itself be fixed) or it has configuration options that are set incorrectly (so should be reconfigured).

Mihail has given a suggestion that allows you to compensate for either of the other problems (with your data or the other software) but you should always appreciate where the problem lies. Personally i'd want to fix the actual problem if at all possible, before I looked at ways of getting around it.
Dec 9 '11 #5

P: 33
Tks NeoPa & Mihali - Yes there is only the one CR at the end of the file, i'll talk to the vendor of the other application. if they can't fix it then i'll go with the suggestion.
Dec 12 '11 #6

Post your reply

Sign in to post your reply or Sign up for a free account.