472,805 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

How do you show leading zero in exported .csv file?

Hello,

I'm trying to export a query containing contact information, including a
[zipcode] field. Some zip codes have one or two leading zeros, for example,
San Juan, PR (00927) and Springfield, MA (01104). When I export to a comma
separated value (.csv) file, the zip code for San Juan becomes "927" and for
Springfield becomes "1104". How can I prevent the leading zero(s) from being
trimmed in the exported .csv file?

Because the table contains both USA and Canadian addresses, the underlying
[PostalCode] field in the original table is a text value. Does that make a
difference?

I have observed that the leading zero remains in records where the data in
that field contains zip+4 information, for example, "01104-0430".

Thanks,
Joshua Ammann
Nov 12 '05 #1
1 12715
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Your export specification has identified the postal code column as a
numeric column and is stripping off the leading zeros. You'll need to
change the export spec to have that column a text data type. To get
to the export/import specifications (if you don't know):

File > Get External Data > Import

highlight a text file (any one, we're just using it to open the Text
import wizard) - when the import wizard dialog box appears click the
advanced button - when the specifications dialog box appears click the
Specs command button - select the specification name that has the name
of the query you were trying to export - look for the PostalCode
column definition in the specifications dialog box subform & change
its data type to Text.

HTH,

MGFoster:::mgf
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBP8LCFoechKqOuFEgEQKjOgCcD28q2HnI2Xjp9Wk6W90A0n kG0VsAn3Qj
cPqe55XW2zpfdd3UUmYXFp5l
=77Iv
-----END PGP SIGNATURE-----

Joshua Ammann wrote:
Hello,

I'm trying to export a query containing contact information, including a
[zipcode] field. Some zip codes have one or two leading zeros, for example,
San Juan, PR (00927) and Springfield, MA (01104). When I export to a comma
separated value (.csv) file, the zip code for San Juan becomes "927" and for
Springfield becomes "1104". How can I prevent the leading zero(s) from being
trimmed in the exported .csv file?

Because the table contains both USA and Canadian addresses, the underlying
[PostalCode] field in the original table is a text value. Does that make a
difference?

I have observed that the leading zero remains in records where the data in
that field contains zip+4 information, for example, "01104-0430".

Thanks,
Joshua Ammann


Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: LRW | last post by:
This may be a question more directed to Excel, but I'm using PHP to generate a CSV to be imported into Excel, so maybe the solution is there. So, sorry for crossposting. Anyway, I'm generating a...
6
by: david | last post by:
Hi, I have an application as follows: MySQL database Back-Eend linked to MS Access Front-End and ASP Web Application. I require users to enter Serial Numbers such as: 0105123567 (10...
7
by: david | last post by:
Hi, I have 2 text boxes on an ASP form. A user enters a Serial Number in TB1 such as 0105123456, presses tab to move to TB2, TB2 then displays the value of TB1 after a calculation has been...
6
by: Clint Stowers | last post by:
Using A2k Exporting a query to a CSV file. The problem is any text fields (i.e. 000345) lose any leading zeros. Exporting to an excel file this problem does not exist. Tried to create a...
2
by: chris | last post by:
Hi, I have a simple ms access application that allows you to scan barcodes in to a form which stores them in the database. The barcodes are 6 digits in length e.g. 555666 but my handheld...
5
by: GarryJones | last post by:
I have code numbers in 2 fields from a table which correspond to month and date. (Month, Code number) Field name = ml_mna 1 2 3 etc up to 12 (Data is entered without a leading zero)
8
by: Andrew Poulos | last post by:
In my limited testing with FF 2, IE 6 and Opera 9 when I divided a positive integer, that is less than 100, by 100 I get a leading zero in front of the decimal point. For example 80/100 gives...
4
by: bobm2005 | last post by:
Whatever format I try in Printf, an 'E' format number nearly always has a leading non-zero:- 1.2345E7 -9.3456E8 etc. Is it possible to force it (printf) always to have leading zero? ...
6
by: JimmyKoolPantz | last post by:
Task: Customer wants a script of the data that was processed in a "CSV" file. Problem: Zip-Code leading zeros are dropped Basically we have a client that has requested a custom script for...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.