473,320 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

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).

5 1674
Rabbit
12,516 Expert Mod 8TB
That shouldn't cause any problems. Is the last carriage return causing a problem?
Dec 7 '11 #2
Quizzed
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
Mihail
759 512MB
Just an idea:
Reopen the file (after transfer) and remove last character(s).
Dec 8 '11 #4
NeoPa
32,556 Expert Mod 16PB
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
Quizzed
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

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

Similar topics

6
by: foldface | last post by:
Hi I have a table and I've been trying to find a way to stop the text in the table being selectable. One article nearly works for me: ...
5
by: Tim Eliot | last post by:
Just wondering if anyone has hit the following issue and how you might have sorted it out. I am using the command: DoCmd.TransferText acExportMerge, , stDataSource, stFileName, True after...
3
by: Roel Schoonveld | last post by:
In Access 97 I made an application that makes text files that are exported. The names of the files contain two variables: 1. the value of the field BRIN in a table VasteGegevens of my database....
1
by: cab2 | last post by:
We currently have an application built in Access that takes in a csv file using docmd.transfertext. We allow users to export their data to a file for later use (csv format). Users are also...
1
by: VB Programmer | last post by:
I have a comma delimited export file with 10 columns. I want to display the first 5 and the last 2 columns in a datagrid or table. Is there any way to do this automatically? If not, does anyone...
6
by: Winshent | last post by:
How do you stop form information being stored such as credit card info in a textbox?
44
by: Jeff | last post by:
Hi I have a library mde that is used with some customer databases and I found out that another developer discovered it while doing some maintenance work on an old database for the same customer...
0
by: Spam Catcher | last post by:
Hi all, Are there any good export file libraries besides filehelpers? http://filehelpers.sourceforge.net/ I'm looking for something where I can pass in a DataTable, Collection, etc, and the...
4
by: HoganGroup | last post by:
I need to create an export file for the following brutal query to upload into a state database (go figure it's a government report!) All was good in my world until I tried to export. Manually or...
4
by: Waldy | last post by:
Hi there, I am reading a string from a web.config file and displaying it in a label on an .ASPX page. I want a carriage return in the string so that it looks right, but can't get it to put one...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.