Dropping leading zeros in CSV file

Hi everyone,

When I am trying to read a cell in csv file, blue prism is dropping leading zeros. Is there a way to get the value with the leading zeros.
For example in csv file it is 0012345 but when blue prism reads it is taking as 12345. Please provide solution.


Regards,
Mani
 
In the collection i am setting the Field type as text while reading the value from cell. Even i tried setting the Field type as Number but I am unable to get the leading zeros.


Regards,
Mani.
 
In the collection i am setting the Field type as text while reading the value from cell. Even i tried setting the Field type as Number but I am unable to get the leading zeros.


Regards,
Mani.
What object and action are you using to read the value from the cell? Excel VBO?

When Excel opens CSV files it drops the leading zeroes. This isn't to do with the CSV file it is an Excel issue. See here for some details.

I can't recommend a way to deal with the issue until you describe how you are reading the data in Blue Prism.
 

VJR

Well-Known Member
Hi Mani,

I'm trying to understand the action you are using for getting the data from the csv.
Are you using the 'Get CSV Text As Collection'?
 
I have tried with the following options
1)Get CSV Text As Collection
2)Using Excel instance and Get worksheet as collection actions

But I am unable to get the leading zeros.

Regards,
Mani
 

VJR

Well-Known Member
I have tried with the following options
1)Get CSV Text As Collection
2)Using Excel instance and Get worksheet as collection actions

But I am unable to get the leading zeros.

Regards,
Mani
Hi Mani,

You mentioned that in the csv file it is 0012345. You must have opened the csv file in Notepad and observed this value.
The same value when opened in an Excel csv will be 12345 and the data type (Format cells) of that cell must have been General or a Number. So open that in excel and check. Before opening make a backup copy of the original file as opening/closing it at times screws up the data and formatting in the file.
 

rpame

New Member
Its Excel that is removing the leading zeros. But that can be fixed in Excel. I have also noticed that the Get CSV Text as Collection also remove leading zeroes.
 
Top