<oXygen/> 6.0 mac: Excel import bug ?

Having trouble installing Oxygen? Got a bug to report? Post it all here.
ian
Posts: 5
Joined: Fri Mar 25, 2005 2:04 pm

<oXygen/> 6.0 mac: Excel import bug ?

Post 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
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post 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
ian
Posts: 5
Joined: Fri Mar 25, 2005 2:04 pm

Post 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
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post 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
Post Reply