A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Double Quote marks duplicated when outputting text to file



 
 
Thread Tools Display Modes
  #1  
Old November 3rd, 2008, 12:22 PM posted to microsoft.public.access
jon
external usenet poster
 
Posts: 34
Default Double Quote marks duplicated when outputting text to file

Hi,
I want to export a list of customer accounts into a Google KML file, so that
clicking on the file will show all their locations on google earth.

I have managed to generate the correct format of the KML file using a
function I have created in Access97, and the output of the function is
perfectly accurate.

I have then saved the output to a text file ( but added a KML extension) ,
but during the output stage, double quotations are added at the beginning
and at the end of the functions content, and in addition any double
quotations that existed within the string are repeated.

For example
The first line should read
?xml version="1.0" encoding="UTF-8"?

But it actually exports as
"?xml version=""1.0"" encoding=""UTF-8""?

Here's how I create my KML file using my function

Open "C:\Users\JON.DONKEYNOB\Desktop\GOOGLE_EARTH" & [txt_type] & ".KML"
For Output As #1
Write #1, GENERATE_GOOGLE_EARTH_LOCATIONS([txt_type])
Close #1


The variable txt_type is just a way that my function knows if I want to
export live customers or potential customers from our sales

Any help appreciated.

Jon


  #2  
Old November 3rd, 2008, 01:33 PM posted to microsoft.public.access
John Spencer
external usenet poster
 
Posts: 7,815
Default Double Quote marks duplicated when outputting text to file

Try using Print instead of Write

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County

jon wrote:
Hi,
I want to export a list of customer accounts into a Google KML file, so
that clicking on the file will show all their locations on google earth.

I have managed to generate the correct format of the KML file using a
function I have created in Access97, and the output of the function is
perfectly accurate.

I have then saved the output to a text file ( but added a KML extension)
, but during the output stage, double quotations are added at the
beginning and at the end of the functions content, and in addition any
double quotations that existed within the string are repeated.

For example
The first line should read
?xml version="1.0" encoding="UTF-8"?

But it actually exports as
"?xml version=""1.0"" encoding=""UTF-8""?

Here's how I create my KML file using my function

Open "C:\Users\JON.DONKEYNOB\Desktop\GOOGLE_EARTH" & [txt_type] &
".KML" For Output As #1
Write #1, GENERATE_GOOGLE_EARTH_LOCATIONS([txt_type])
Close #1


The variable txt_type is just a way that my function knows if I want to
export live customers or potential customers from our sales

Any help appreciated.

Jon


  #3  
Old November 3rd, 2008, 03:05 PM posted to microsoft.public.access
jon
external usenet poster
 
Posts: 34
Default Double Quote marks duplicated when outputting text to file

Thats fantastic John,
Thanks for your help.

I now have to replace some & characters within my script with + symbols
(because I've found that Google doesn't like the & symbol.

Any ideas how to do a find and replace within my function ?


Jon

"John Spencer" wrote in message
...
Try using Print instead of Write

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County

jon wrote:
Hi,
I want to export a list of customer accounts into a Google KML file, so
that clicking on the file will show all their locations on google earth.

I have managed to generate the correct format of the KML file using a
function I have created in Access97, and the output of the function is
perfectly accurate.

I have then saved the output to a text file ( but added a KML extension)
, but during the output stage, double quotations are added at the
beginning and at the end of the functions content, and in addition any
double quotations that existed within the string are repeated.

For example
The first line should read
?xml version="1.0" encoding="UTF-8"?

But it actually exports as
"?xml version=""1.0"" encoding=""UTF-8""?

Here's how I create my KML file using my function

Open "C:\Users\JON.DONKEYNOB\Desktop\GOOGLE_EARTH" & [txt_type] & ".KML"
For Output As #1
Write #1, GENERATE_GOOGLE_EARTH_LOCATIONS([txt_type])
Close #1


The variable txt_type is just a way that my function knows if I want to
export live customers or potential customers from our sales

Any help appreciated.

Jon

  #4  
Old November 3rd, 2008, 05:43 PM posted to microsoft.public.access
John Spencer
external usenet poster
 
Posts: 7,815
Default Double Quote marks duplicated when outputting text to file

Use the Replace function?

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County

jon wrote:
Thats fantastic John,
Thanks for your help.

I now have to replace some & characters within my script with + symbols
(because I've found that Google doesn't like the & symbol.

Any ideas how to do a find and replace within my function ?


Jon

"John Spencer" wrote in message
...
Try using Print instead of Write

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County

jon wrote:
Hi,
I want to export a list of customer accounts into a Google KML file,
so that clicking on the file will show all their locations on google
earth.

I have managed to generate the correct format of the KML file using a
function I have created in Access97, and the output of the function
is perfectly accurate.

I have then saved the output to a text file ( but added a KML
extension) , but during the output stage, double quotations are added
at the beginning and at the end of the functions content, and in
addition any double quotations that existed within the string are
repeated.

For example
The first line should read
?xml version="1.0" encoding="UTF-8"?

But it actually exports as
"?xml version=""1.0"" encoding=""UTF-8""?

Here's how I create my KML file using my function

Open "C:\Users\JON.DONKEYNOB\Desktop\GOOGLE_EARTH" & [txt_type] &
".KML" For Output As #1
Write #1, GENERATE_GOOGLE_EARTH_LOCATIONS([txt_type])
Close #1


The variable txt_type is just a way that my function knows if I want
to export live customers or potential customers from our sales

Any help appreciated.

Jon

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:17 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.