CSV trailing zeros

imeade

New Member
Joined
Jun 28, 2022
Messages
16
Office Version
  1. 365
Platform
  1. Windows
I have a process in place that saves an excel file as a csv but I need the csv to preserve the trailing zero on the postingperiod column.

When the csv is created, it is removing the trailing zero from "2022.10" resulting in "2022.1", is there some vba code out there that can force the trailing zero to remain intact? I have tried various things with no luck.

Thanks
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Are you sure that the trailing zero is really being removed?
If you have the Excel file formatted properly to show the trailing zero, and then save as a CSV, it should keep that trailing zero.

Where people get into trouble is that they then try to view the resulting CSV in Excel.
Never view a CSV file in Excel if you want to maintain all the formatting!!!

When you open a CSV file in Excel, Excel automatically applies its own data conversions to the file. So you NOT seeing the data as it actually appears in the CSV.
ALWAYS use a Text Editor (like NotePad) to open and view CSV files if you want to see what the data REALLY looks like in the CSV file.
If you view the created CSV file in NotePad, do you see the trailing zeroes?
 
Upvote 0
Solution
Are you sure that the trailing zero is really being removed?
If you have the Excel file formatted properly to show the trailing zero, and then save as a CSV, it should keep that trailing zero.

Where people get into trouble is that they then try to view the resulting CSV in Excel.
Never view a CSV file in Excel if you want to maintain all the formatting!!!

When you open a CSV file in Excel, Excel automatically applies its own data conversions to the file. So you NOT seeing the data as it actually appears in the CSV.
ALWAYS use a Text Editor (like NotePad) to open and view CSV files if you want to see what the data REALLY looks like in the CSV file.
If you view the created CSV file in NotePad, do you see the trailing zeroes?
Thanks, there was some confusion on import template within NetSuite, thanks for the insight
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,636
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top