Facing issue withe Excel format while Write text file data into Excel

Hi All

I am facing issue with Excel format,

1.reading text file using read text activity
2.write text activity to save text file into.xls
3.in excel if company code contain 01234 it is displaying like 1234 but in text file I am able to see 01234.
4.value 0 is hiding / deleting from excel while trying to do manually also I am facing same thing

I need exact company code whatever I am reading from text file and same format should be in excel as well.

Best Regards,
Navee

Hello @Naveen.Ch

As i can 01234 is an integer, so if you want to write it into excel then you have to write it as a string not integer.

So you can do one thing add ’ to 012345 like below. ’ 01234

so that when you write it to excel it will display as a string.

Or if you build a data table to store the data from text file then you can change the data type to string
Regards
Ajay

1 Like

@Naveen.Ch

Go to that column in excel file and then go to Format cells option Number - > Custom and then type 0’s based on length of your company code. If it is five digit then enter five 0’s and apply it.

3 Likes

@Naveen.Ch Convert your column to string , as excel doesn’t show leading zero’s in any format including CSV, you have to convert that to string or as company code is mostly 4 digits you can do a padleft(“COCD”,“0000”) at run time to go with the process.

1 Like

Hi @Ajju

Thanks for the response.

First I am reading the data from text file in that text file contain more than 15 columns data

So I am saving the text file data into Excel for my convenience to add each row wise to queue.

While trying to add the data into queue prefix value is missing if it start with 0 means specific column

Hi @lakshman,

Thanks for the response.

How can I do using uipath to change the specific column format before reading the data from excel

1 Like

Hi @WhenCutEsh,

Company code = Dt(0)(company code).toString
I am reading the first row of specific column ,still it is missing first value if it start with 0

@Naveen.Ch yeah u have to use pad left on your string it will give you four digits at runtime try using it

Hi,
Yes @lakshman is right. you can change the format of the cell. Here is link to change the cell format.

Regards
Balamurugan.S

2 Likes

Hello @Naveen.Ch

While adding into queue you add so it will consider the value as a string, will disappear when you write it to an excel.

Regards
Ajay

1 Like

Hi @balupad14,

Thanks for the response.

It is applicable for 2018.4.4 version

Best Regards,
Naveen

1 Like