Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: dwayneramsayHi All,
I'm New to Lavastorm and BRE. I need to pull data from a number of varying excel formats - however, the fieldname may be difference...
For example one sheet may contain the same data but the field/column name for one might be Destination and the other DestinationName.
How can I configure the nodes to handle and normalize.
Ii was trying to use the following code but get the error:
input_fields = inputFields(1)
cc_exists = input_fields.find("Destination")
country_code = str(null)
if (cc_exists <> -1) then
{
country_code = field("Country Code").str().trim()
}
else
{
country_code = ""
}
However, I still get the following error, even though the condition evaluates to false:
ERROR initializing expert output:
unknown field for source '': 'Country Code'
2012-07-12 12:52:00.000; WARN: unknown field for source '': 'Country Code'
id: 0 chain: 0 group: 0
cppDetail: context: Salmon::NED::Field_Expr::findField() ..\expert\Field_Expr.cpp@140
2012-07-12 12:52:00.000; WARN: ...in combination starting on line 28
id: 0 chain: 0 group: 0
cppDetail: context: ..\expert\Combination_Expr.cpp@92
2012-07-12 12:52:00.000; WARN: ...in combination starting on line 28
id: 0 chain: 0 group: 0
cppDetail: context: ..\expert\Combination_Expr.cpp@92
2012-07-12 12:52:00.000; WARN: ...in combination starting on line 28
id: 0 chain: 0 group: 0
cppDetail: context: ..\expert\Combination_Expr.cpp@92
2012-07-12 12:52:00.000; WARN: ...exception seen
id: 0 chain: 0 group: 0
cppDetail: context: Salmon::NED::BrainScriptSet_ExprStmt::BrainScriptS et_ExprStmt() .\BrainScriptSet_ExprStmt.cpp@60
2012-07-12 12:52:00.000; WARN: ...in statement starting on line 28
id: 0 chain: 0 group: 0
cppDetail: context: Salmon::NED::Statement_Expr::tryParseStatement() ..\expert\ExprStatement.cpp@158
2012-07-12 12:52:00.000; WARN: ...in expression starting on line 28
id: 0 chain: 0 group: 0
cppDetail: context: Expr::parseExpr() ..\expert\Expr.cpp@89
2012-07-12 12:52:00.000; WARN: ...in expression starting on line 26
id: 0 chain: 0 group: 0
cppDetail: context: Expr::parseExpr() ..\expert\Expr.cpp@89
2012-07-12 12:52:00.000; WARN: ...handling expression #14 in file
id: 0 chain: 0 group: 0
cppDetail: context: Salmon::NED::ExprTableIo::initialize() .\ExprTableIo.cpp@86
2012-07-12 12:52:00.000; WARN: ...exception seen
id: 0 chain: 0 group: 0
cppDetail: context: Salmon::NED::NodeControl::initializeExpert() .\NodeControl.cpp@1311
Appreciate any assistance
Regards,
Dwayne