Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HI all,
I am attempting to apply a mapping to some badly named data. I want to associate a string with an extra embedded space with the correct spelling with the extra space:
GroupMap:
Mapping load * inline [
string with extra space, string with extra space,
...
]
...
Load
...
ApplyMap('GroupMap',[Group Name]),
...;
The mapping doesn't take - both instances of the string still appear in the incoming data. I have tried placing the strings in quotes - double and single - to no avail. I'm loading from a series of text files.
Has anyone encountered this before? And hopefully solved it?
I don't have any problems with the mapping respecting extra spaces. It might be the version, but test the following script to see what it gives you. Maybe the mapping doesn't work because of extra spaces before or after the strings. If that's the case, use trim().
Karl
Map_Table:
Mapping LOAD * INLINE [
Text_From, Text_To
test spaces, test spaces
];
Test_Table:
LOAD * INLINE [
Text
test spaces
];
Test_Table_Fixed:
NoConcatenate
LOAD ApplyMap('Map_Table',Text) as Text
Resident Test_Table;
Drop table Test_Table;
I don't have any problems with the mapping respecting extra spaces. It might be the version, but test the following script to see what it gives you. Maybe the mapping doesn't work because of extra spaces before or after the strings. If that's the case, use trim().
Karl
Map_Table:
Mapping LOAD * INLINE [
Text_From, Text_To
test spaces, test spaces
];
Test_Table:
LOAD * INLINE [
Text
test spaces
];
Test_Table_Fixed:
NoConcatenate
LOAD ApplyMap('Map_Table',Text) as Text
Resident Test_Table;
Drop table Test_Table;
I ran the test script and it worked. Turns out there is a leading space in the bad string. Thanks for the help!