Hi,
This is my FMT:
<?xml version="1.0" encoding="UTF-8"?>
<Record name="RECORD_achan_fix_testfile_1_txt_" type="fixed" recordDelimiter="\r\n">
<Field name="amount" type="numeric" nullable="false" size="10" format="¤#,###,###,###" locale="en.US"/>
<Field name="code" type="string" nullable="false" size="1"/>
</Record>
my data looks like this:
amount code
$1000 a
$2000 b
if I read this input and directly pass it out to a DataWriter, I got:
amount code
$1,000 a
$2,000 b
However, if I have data that looks like:
amount code
1000 a
2000 b
I got this errors like this:
WARN [INPUT_0] - amount (numeric) cannot be set to "1000" in field # 1
of record # 1
looks like it cannot handle optional currency symbol, but it can handle optional commas...
any suggestions?
Thanks,
al
This is my FMT:
<?xml version="1.0" encoding="UTF-8"?>
<Record name="RECORD_achan_fix_testfile_1_txt_" type="fixed" recordDelimiter="\r\n">
<Field name="amount" type="numeric" nullable="false" size="10" format="¤#,###,###,###" locale="en.US"/>
<Field name="code" type="string" nullable="false" size="1"/>
</Record>
my data looks like this:
amount code
$1000 a
$2000 b
if I read this input and directly pass it out to a DataWriter, I got:
amount code
$1,000 a
$2,000 b
However, if I have data that looks like:
amount code
1000 a
2000 b
I got this errors like this:
WARN [INPUT_0] - amount (numeric) cannot be set to "1000" in field # 1
of record # 1
looks like it cannot handle optional currency symbol, but it can handle optional commas...
any suggestions?
Thanks,
al
-
Hello,
we use java.text.NumberFormat for parsing/formatting data in numeric field, so the behavior of parsing clover data field is the same like NumberFormat. -
Hi Agata,
Thanks for the clarification....
al
Please sign in to leave a comment.
Comments 2