Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tables: Text files with Windows line endings cannot be read on Linux #1264

Closed
modelica-trac-importer opened this issue Jan 14, 2017 · 12 comments
Assignees
Labels
bug Critical/severe issue L: C-Sources Issue addresses Modelica/Resources/C-Sources

Comments

@modelica-trac-importer
Copy link

Reported by beutlich on 3 Sep 2013 15:29 UTC
This was never tested: Text files with Windows line endings (= CRLF) cannot be read by ModelicaStandardTables on Linux. Error message is: "Error in line when reading numeric data of matrix ...". Workaround is to change line endings to Linux style (= LF).

I have a patch running bit would like to see it tested on Linux and Mac.


Migrated-From: https://trac.modelica.org/Modelica/ticket/1264

@modelica-trac-importer modelica-trac-importer added this to the MSL3.2.2 milestone Jan 14, 2017
@modelica-trac-importer modelica-trac-importer added bug Critical/severe issue L: C-Sources Issue addresses Modelica/Resources/C-Sources labels Jan 14, 2017
@modelica-trac-importer
Copy link
Author

Comment by sjoelund.se on 5 Sep 2013 10:03 UTC
Do you have an example model (perhaps in MSL), and the text-file I should change line endings on to test this?

@modelica-trac-importer
Copy link
Author

Comment by beutlich on 5 Sep 2013 11:01 UTC
The problem was reported by Tove but I actually cannot reproduce it. It always works with or without patch for both Win and Unix line endings on Win and Linux platform. Mac was not tested. Also note that Mac line endings are not supported so there is no need to test it.

You can use the CombiTimeTable with source:Modelica/trunk/Modelica/Resources/Data/Tables/test.txt and manually convert line endings.

@modelica-trac-importer
Copy link
Author

Comment by sjoelund.se on 5 Sep 2013 11:07 UTC
OK, running:

loadModel(ModelicaTest);getErrorString();
simulate(ModelicaTest.Tables.CombiTimeTable.Test50);getErrorString();

Gives me (converted to Windows line-endings):

Error in line 230 when reading numeric data of matrix \"longLine(2,2500)\" from file \"/home/marsj/trunk/build/lib/omlibrary/Modelica 3.2.1/Resources/Data/Tables/test.txt\"

@modelica-trac-importer
Copy link
Author

Comment by sjoelund.se on 5 Sep 2013 11:07 UTC
I will try the patch

@modelica-trac-importer
Copy link
Author

Comment by tove.bergdahl on 5 Sep 2013 11:10 UTC
Replying to [comment:3 sjoelund.se]:

OK, running:

loadModel(ModelicaTest);getErrorString();
simulate(ModelicaTest.Tables.CombiTimeTable.Test50);getErrorString();

Gives me (converted to Windows line-endings):

Error in line 230 when reading numeric data of matrix \"longLine(2,2500)\" from file \"/home/marsj/trunk/build/lib/omlibrary/Modelica 3.2.1/Resources/Data/Tables/test.txt\"

This is the same error as I got.

@modelica-trac-importer
Copy link
Author

Comment by sjoelund.se on 5 Sep 2013 11:12 UTC
The patch does resolve the issue on Linux. Do you need me to also test OSX? (It treats text-files the same way as Linux/Unix-based systems)

@modelica-trac-importer
Copy link
Author

Comment by beutlich on 5 Sep 2013 11:15 UTC
Replying to [comment:6 sjoelund.se]:

The patch does resolve the issue on Linux. Do you need me to also test OSX? (It treats text-files the same way as Linux/Unix-based systems)

OK, thanks. If you think there is no need to test on OSX we can skip it.

@modelica-trac-importer
Copy link
Author

Comment by beutlich on 5 Sep 2013 11:21 UTC
Resolved by 17a0e6d.

@modelica-trac-importer
Copy link
Author

Comment by dietmarw on 5 Sep 2013 14:54 UTC
Also applied to maintenance/3.2.1 in 072f748

@modelica-trac-importer
Copy link
Author

Modified by dietmarw on 15 Nov 2013 13:35 UTC

@modelica-trac-importer
Copy link
Author

Modified by beutlich on 18 Aug 2014 19:57 UTC

@modelica-trac-importer
Copy link
Author

Changelog modified by beutlich on 18 Aug 2014 19:57 UTC
Fixed reading table files with Windows line endings on Linux (ModelicaStandardTables.c)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Critical/severe issue L: C-Sources Issue addresses Modelica/Resources/C-Sources
Projects
None yet
Development

No branches or pull requests

2 participants