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

gFileOpen fails with trailing whitespace at the end of the file. #4

Open
jordansread opened this issue Jan 16, 2013 · 10 comments
Open
Assignees

Comments

@jordansread
Copy link
Member

Datenum fails with multiple lines of empty space after the end of time series data.

@ghost ghost assigned lawinslow Apr 17, 2013
@jordansread
Copy link
Member Author

This may be resolved with my latest commits. Haven't tested.

@jordansread
Copy link
Member Author

Nope, probably will still fail.

@lawinslow
Copy link
Member

Really? gFileOpen uses the builtin datenum function, which seems to handle trailing spaces just fine.

datestr(datenum('2011-01-01 10:30 ','yyyy-mm-dd HH:MM')).

Do you have an example file which shows this phenomenon?

-Luke

@jordansread
Copy link
Member Author

Actually, this is trailing empty lines. Poor wording on my part. e.g. a bunch of empty lines at the end of the files.

@lawinslow
Copy link
Member

Ah, that's from the textscan function then. Could research alternatives if this represents a major issue....

@jordansread
Copy link
Member Author

yeah, its just a fairly common error that people get but they don't really understand why. Creating a file in excel with some extra rows, convert to .wtr...error in LA. Low priority unless there is an easy fix.

@lawinslow
Copy link
Member

Ah. Let me think about it and play around later.

Here is a question, some import methods are more liberal than textscan,
but they don't support as liberal an interpretation of "NaN" or "No
Data". What is more important? Diversity in forms of NA or this type of
error?

-Luke

On 2013-05-09 2:28 PM, Jordan S Read wrote:

yeah, its just a fairly common error that people get but they don't
really understand why. Creating a file in excel with some extra rows,
convert to .wtr...error in LA. Low priority unless there is an easy fix.


Reply to this email directly or view it on GitHub
#4 (comment).

@jordansread
Copy link
Member Author

I would say diversity in NaNs. Got to support NA, NaN and #VALUE!
agree?

@lawinslow
Copy link
Member

Yeah, agreed. The solution needs to include both. Check.

On 2013-05-09 2:39 PM, Jordan S Read wrote:

I would say diversity in NaNs. Got to support NA, NaN and #VALUE!
agree?


Reply to this email directly or view it on GitHub
#4 (comment).

@jordansread
Copy link
Member Author

Could wrap the easy/fast solution in a try/catch, and then do a line-by-line solution for the catch. Would be quite slow for big files, but better than not knowing why the error happened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants