• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Hi All

Sowmya

New Member
If i export a csv file to excel it is not takeing the 1st number.

E.g: i have 02314 in csv file, if i export this to excel it is taking only 2314


can anybody help on this
 
suppose a1 = 2314 and b1 = 0

then c1= b1&a1

now you can get your value as it was before....


Regards

CA Mahaveer Somani
 
Hi Mahaveer thanks for that. But my problem is if i open that csv file in excel '0' is hideing. It is not showing like 02314. just like 2314
 
Try to open csv file using Notepad. Does it show leading 0's?


If it does then save the file as text file (Myfile.txt) and then try to import in Excel.


Hth,
 
Hi thanks for your post. In notepad it shows zeros. If i export the same file to excel 0's are hideing
 
Lets consider a1=01234; b1=03245; c1=04567 in excel. I save this sheet as 'sample.csv'.

I want to export this csv to excel. and i want to see the same values of a1,b1,c1 without missing 0's
 
Hi Sowmya ,


1. Open a blank workbook.


2. Select all the cells on a worksheet , and format them as TEXT.


3. Open the file sample.csv using Excel.


Can you do the above and say what happens ?


Narayan
 
As a CSV file Excel is automatically making assumptions about the column types


Rename the file to *.txt

Then open the file

When you import them you will manually have to select those columns as Text

otherwise excel is correctly converting them to Numbers
 
@ Hui :)

Allow me to to elaborate.. :)


@ Sowmya..

* Open a New Workbook.

* Data > Get External Data > From Text..

* locate / Select the CSV File..

* Now In Import screen..Select Delimeted > Next

* Set delimeter "Comma" (for EU countries, may be Semicolon)

* It will display all Column..

* Next >

* Set Data Format to TEXT instead of General.. for all the expected columns.. which you want to display Leading ZEROs.. (ie 3rd Column & 7th Column)

* Finish..


Let us know the result..

By the way.. Did you ever worked with OPEN OFFICE.. :)


Regards,

Deb
 
Thanks Debraj Roy...


I am getting the output but what happens is if i again convert that excel to csv the format changs
 
Sowmya


Deb and I have given you two solutions that do what you want


There are no settings in Excel that control the import of Txt/CSV files


If you are converting regularly to CSV and re-importing to Excel I'd ask the question why? I assume another system is using the file in between?

can that other system import/export Excel file types?


If your just using the file over and over in Excel leave it as XLSX format


If your going to be doing this regularly write a macro to export and import for you
 
I've recently come across the same issue -- losing leading zeros when importing a .csv or a .txt file into excel. My solution: during the import process (ie. in the 'text import wizard' change the format of the column that contains that data to text or general.
 
Back
Top