The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Decimal separator for CSV files
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

dominik.mierzwa

Poland
119 Posts

Posted - 02/02/2020 :  11:26:24 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 2020 (64-bit)
9.7.0.185 (Academic)
Operating System: Windows 10 Pro

Hi,
I noticed that during the import of CSV files, the decimal separator is by default set to comma (regardless of the settings in the Options>Numeric format tab). If the same file is imported as ASCII, everything is OK.
For example, I have data in the following form:
1.1;1.2;1.3;1.4 (dot as decimal separator and semicolon as data separator)
After CSV import the decimal separator is removed and I got:
11 | 12 | 13 | 14

When the same set of data is imported as ASCII file everything works perfectly.
When I changed the data set:
1,1;1,2;1,3;1,4 (comma as decimal separator and semicolon as data separator)
and imported it as CSV, everything works perfectly.

The question is how to set up the decimal separator (to dot) during CSV import?


Kind regards,
Dominik

cpyang

USA
1406 Posts

Posted - 02/02/2020 :  11:59:27 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Can you try using the CSV connector?

Choose Data->Connect to File->CSV

The decimal separator should be automatically detected. If this does not work, can you send the file to tech@originlab.com?

CP

Go to Top of Page

dominik.mierzwa

Poland
119 Posts

Posted - 02/02/2020 :  12:39:16 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Ok. I wll try this tomorrow. I read about connector and I'm wondering if there is a possibility to work with templates. I usually prepare one sheet with the analysis and import next files using the Template name: clone option.

Kind regards,
Dominik

Edited by - dominik.mierzwa on 02/02/2020 12:41:26 PM
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 02/02/2020 :  2:57:09 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can setup the template with any file, then load that template, choose a new Data Source from the Connector Icon to pick a new file, and the rest will update accordingly.

You can also use the LabTalk script to change the data source with

wks.dc.source$

CP
Go to Top of Page

dominik.mierzwa

Poland
119 Posts

Posted - 02/06/2020 :  07:54:42 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Ok, I have tested the proposed solution and it is not good for me because I have to define the new source for each dataset. During previous data processing, I created the template sheet, made all necessary data manipulation and next use Import multiple xls files with "clone template" and it worked fine.



Currently, I need to work with CSV files and it fails because the decimal separator is wrongly recognized. Of course, I can change the decimal separator (from dot to comma) in the source files but it is not the point. Of course, I can write the script to import data automatically but I'm a newbie in Labtalk (I have never work with this language) and need to spend some time to learn how to do this.

Moreover, I tried also an option with multiple ASCII import, but in this method, the problem is that data are always imported from the first cell of the sheet. Despite the definition of the 'Output' to the first cell of theSECOND column data is always imported to the first cell of the FIRST column.



What should I do to import ASCII data to the range which begins in the first cell of the second column?

Kind regards,
Dominik

Edited by - dominik.mierzwa on 02/06/2020 08:00:03 AM
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 02/07/2020 :  10:11:03 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Can you give details about how the CSV Data Connector is not working? It seems that you are not using data connector?

1. was the decimal separator correctly detected using CVS Data Connector?
2. for a single file, is your user story using analysis template working well?
3. Did you then try to change data source from the connector icon and notice a problem?

I need to know what exactly is the problem with CSV connector in your user story so we can improve it. We are going to have a new beta of Origin 2020b, so is it possible that we can work with you on this to get it all working?


CP
Go to Top of Page

dominik.mierzwa

Poland
119 Posts

Posted - 02/08/2020 :  2:57:55 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Firstly:
I noticed that if during the Import the "Replace Existing Data" is chosen, then the definition of Output is not taken into account. That is why the data was always imported from the first cell of the first column. I'm not sure if it is correct.

Secondly:
Ad. 1 CVS data connector works perfectly, and recognize decimal separator.

Ad. 3 After using CSV Data connector I changed the data source and everything worked fine.

Ad. 2 Maybe the way I analyze my data is not the easiest one but so far it worked. I did not use the analysis template and batch processing because the Report sheet is not updated after data change. I use my personal "analysis template". This project has one "template sheet" which I use during "Clone import" and in this way, I get the analysis of new data.

I'm not familiar with how to automate my work with the use of CVS data connector.
I can send you this file, it could be more convenient to analyze the problem.



Kind regards,
Dominik
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 02/09/2020 :  2:35:09 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Sure, please send us the needed files, to tech@originlab.com
Please include two data files, so we can try to reproduce this.

CP
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000