extra spaces when saving a csv file

G

Guedj54

when saving a csv file from access using:
Print #1, (rst.Fields(0).Name), ",", (rst.Fields(1).Name), ",", (rst.Fields(2).Name)

it save it but with extra spaces between the fields:
TARIFF_PRODUCT_ID , PRODUCT_ID , PARTNER

This cause view problem when opening it in Excel.
I would rather save it as:
TARIFF_PRODUCT_ID,PRODUCT_ID,PARTNER

Any Ideas.
Thanks,
Raphael
 
S

Steve

Raphael,

Try using the Trim function to remove the spaces;

Trim(rst.Fields(0).Name)


Steve.
-----Original Message-----
when saving a csv file from access using:
Print #1, (rst.Fields(0).Name), ",", (rst.Fields
(1).Name), ",", (rst.Fields(2).Name)
it save it but with extra spaces between the fields:
TARIFF_PRODUCT_ID ,
PRODUCT_ID , PARTNER
 
A

Alex Dybenko

try:
Print #1, (rst.Fields(0).Name);","; (rst.Fields(1).Name); ",";
(rst.Fields(2).Name)

; instead of ,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top