extra spaces when saving a csv file

  • Thread starter Thread starter Guedj54
  • Start date Start date
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
 
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
 
try:
Print #1, (rst.Fields(0).Name);","; (rst.Fields(1).Name); ",";
(rst.Fields(2).Name)

; instead of ,
 
Back
Top