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

strings with '!' often turn up empty in xls #2

Closed
GoogleCodeExporter opened this issue Apr 14, 2015 · 5 comments
Closed

strings with '!' often turn up empty in xls #2

GoogleCodeExporter opened this issue Apr 14, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. have properties files with strings that end with or use '!' somewhere
2. createXLS
3.

What is the expected output? What do you see instead?
those strings should show up as well

What version of the product are you using? On what operating system?
0.1.2 on mac

Please provide any additional information below.
I think it is caused by the !, but I did not do thorough testing ... yet ... I 
can help with fixing the bug, but have not had time to set up the proj. yet.
I could provide a set of files, but they need to be treated confidentially.
You can contact me at maia@gust.com if you would like the samples.

Original issue reported on code.google.com by m...@gust.com on 6 Oct 2011 at 10:40

@GoogleCodeExporter
Copy link
Author

I did a search on the xls (more than 6000 rows) , none of the fields has a '!' 
except in the column with the chines translation and characters. 

Original comment by m...@gust.com on 6 Oct 2011 at 11:07

@GoogleCodeExporter
Copy link
Author

easy to fix:
line 71 in PropertyFileContentParser is:
Pattern patternComment = Pattern.compile( "([^\\#]*)(\\!|\\#)(.*)" );
but should be: 
Pattern patternComment = Pattern.compile("([\\s]*)(\\!|\\#)(.*)");
according to 
http://download.oracle.com/javase/7/docs/api/java/util/Properties.html:
 "A comment line has an ASCII '#' or '!' as its first non-white space character"

Original comment by m...@gust.com on 14 Oct 2011 at 6:05

@GoogleCodeExporter
Copy link
Author

Thanks for your additional mail, it made me recongnize the issue. 

You are completly right, the line you pointed out should be fixed like this. I 
will fix it as soon as possible.

Original comment by awonderl...@googlemail.com on 14 Oct 2011 at 7:35

@GoogleCodeExporter
Copy link
Author

Fixed this issue with 0.1.3 release

Can you please verify?

Original comment by awonderl...@googlemail.com on 14 Oct 2011 at 10:05

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Had to change the above code again. Now I remembered why the pattern of a 
comment could not only beginn with spaces: the BOM of UTF-8 encoded files can 
be read in at the first line, and if the first line is a comment line it fails.

I changed it now to 
Pattern patternComment = Pattern.compile( "([^\\:\\=]{0,4}[\\s]*)(\\!|\\#)(.*)" 
);

which should apply fine, even if not perfectly what the spec says.

Original comment by awonderl...@googlemail.com on 6 Nov 2011 at 9:04

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

No branches or pull requests

1 participant