Page 1 of 1
<oXygen/> 6.0 mac: Excel import bug ?
Posted: Sat Jun 25, 2005 6:01 pm
by ian
Hello,
When I import data from an Excel sheet I, the numbers always have one decimal point however they are are defined in Excel.
For example in my Excel file I have a column called "Reference" which is a numeric field with 0 decimals and a "Prix" column with 2 decimals. When I import I get the following:
<Reference>107681.0</Reference>
<Prix>49.0</Prix>
Is this a bug or am I doing this badly ?
Thanks,
Ian
Posted: Mon Jun 27, 2005 3:00 pm
by sorin_ristache
Hello,
In the current version of <oXygen/> the imported values have exactly one decimal because an Excel integer value is imported as a decimal value with exactly one decimal position (a zero value) and an Excel value defined with two decimal positions but having no actual decimal positions is imported also as a decimal value with one decimal position (also zero value). Does that present a problem for your application ? The import operation could be probably improved so that the exact number of decimals is preserved.
Best regards,
Sorin
Posted: Tue Jun 28, 2005 1:41 pm
by ian
ok I see. Thanks for the explanation.
This doesn't actually present a "problem", just an inconvenience because I have to clean the files using reg expressions.
A "cleaner" import would be nice
Speaking of regular expressions, to get the second "0" decimal required for correct formatting, I am using (<prix>\d+\.\d)(</prix>) as search pattern and \010\02 as replacement pattern. This replacement pattern doesn't work in <oXygen/>. This does work in BBEdit, but it would be nice not to have to resort to a different tool just for this.
Any ideas why this replacement pattern doesn't work ?
Thanks,
Ian
Posted: Tue Jun 28, 2005 2:07 pm
by sorin_ristache
Hello,
ian wrote:Any ideas why this replacement pattern doesn't work ?
The correct replacement expression is
$10$2. Regexp groups are refered by $1, $2, etc. and $0 refers the entire find match. You can see this in the tooltip for the
Replace with field and in the user manual:
http://www.oxygenxml.com/doc/ug-oxygen/ ... place-text
Best regards,
Sorin