CSV Format Issue
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
23-09-19 04:47 AM
Hello - I am currently copying data from a web page and pasting it in a CSV. When Im trying to retrieve the data from the CSV - the number values are being formatted to scientific e-notation. For ex : if the number is 345622342342 before pasting it into a csv and closing that instance. When i try to retrieve the value from the CSV, it is being interpreted like the format ' 3.45E+15 '. How can i retrieve the data in the correct format from the csv? Format Cell option may not work as the cell where the values are stored are dynamic and is based on the data copied. Please let me know if there are any other ways.
Thanks in advance.
------------------------------
Maneesh
------------------------------
Thanks in advance.
------------------------------
Maneesh
------------------------------
4 REPLIES 4
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
23-09-19 06:59 AM
try to use a c# code stage and transform number to integers
------------------------------
Cohen
RPA Developer
Romania
------------------------------
-
float myFloat = 3.5F;
-
int myInt = Convert.ToInt32(myFloat);
myNum = dt.Columns[0];
myNum = int.Parse(dt.Rows[0][0].ToString());
Stackoverflow should be your friendhttps://stackoverflow.com/questions/2592180/how-can-i-convert-this-column-value-to-an-integer
more info can be found here
------------------------------
Cohen
RPA Developer
Romania
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
25-09-19 12:48 PM
Hi Maneesh,
Can you post your sample CSV?
------------------------------
Naga
Associate
Asia/Kolkata
------------------------------
Can you post your sample CSV?
------------------------------
Naga
Associate
Asia/Kolkata
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
13-11-19 04:49 PM
There will probably be a number of other solutions, but one thing you can try is:
- open the CSV as text ( Utility - File Management - Read All Text From File )
- use Utility Strings - Split Text and Split Lines to transform it to a collection in the right format
Basically manipulate the raw text within blue prism, rather than the CSV going through a conversion which seems to be causing your problems.
------------------------------
Willem Borgesius
Technical Director
Delta4Services
Europe/London
------------------------------
- open the CSV as text ( Utility - File Management - Read All Text From File )
- use Utility Strings - Split Text and Split Lines to transform it to a collection in the right format
Basically manipulate the raw text within blue prism, rather than the CSV going through a conversion which seems to be causing your problems.
------------------------------
Willem Borgesius
Technical Director
Delta4Services
Europe/London
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
14-11-19 01:58 PM
Hello, Maneesh
We used to have a lot of problems reading csv files. The best solution we found was using a schema.ini file to set how the csv file should be interpreted.
You can set the data type of a column so you can retrieve it the you need.
Take a look at this link: https://docs.microsoft.com/en-us/sql/odbc/microsoft/schema-ini-file-text-file-driver?view=sql-server-ver15
and the attached file example
Cheers
------------------------------
Diogo Furlan
Analyst
Grupo NC
America/Sao_Paulo
------------------------------
We used to have a lot of problems reading csv files. The best solution we found was using a schema.ini file to set how the csv file should be interpreted.
You can set the data type of a column so you can retrieve it the you need.
Take a look at this link: https://docs.microsoft.com/en-us/sql/odbc/microsoft/schema-ini-file-text-file-driver?view=sql-server-ver15
and the attached file example
Cheers
------------------------------
Diogo Furlan
Analyst
Grupo NC
America/Sao_Paulo
------------------------------
