Searching the Help
To search for information in the Help, type a word or phrase in the Search box. When you enter a group of words, OR is inferred. You can use Boolean operators to refine your search.
Results returned are case insensitive. However, results ranking takes case into account and assigns higher scores to case matches. Therefore, a search for "cats" followed by a search for "Cats" would return the same number of Help topics, but the order in which the topics are listed would be different.
Search for | Example | Results |
---|---|---|
A single word | cat
|
Topics that contain the word "cat". You will also find its grammatical variations, such as "cats". |
A phrase. You can specify that the search results contain a specific phrase. |
"cat food" (quotation marks) |
Topics that contain the literal phrase "cat food" and all its grammatical variations. Without the quotation marks, the query is equivalent to specifying an OR operator, which finds topics with one of the individual words instead of the phrase. |
Search for | Operator | Example |
---|---|---|
Two or more words in the same topic |
|
|
Either word in a topic |
|
|
Topics that do not contain a specific word or phrase |
|
|
Topics that contain one string and do not contain another | ^ (caret) |
cat ^ mouse
|
A combination of search types | ( ) parentheses |
|
- Importing Data from External Sources
- Overview
- Comma Separated Value (CSV) Files
- Databases
- Properties Files
- How to Import CSV Data from an External Source – Scenario
- How to Convert Strings to Numbers
- The External_source_import Package
- Import from CSV File Job
- Import from Database Job
- Import from Properties File Job
- External Source Mapping Files
- Troubleshooting and Limitations – Importing Data from External Sources
How to Convert Strings to Numbers
Converters enable you to specify the way data should be converted between the external source and a CI's attributes.
A CSV file contains records of type string
. However, some of the record values need to be handled as numbers. This is done by adding a converter element to the map element (in [your mapping file name].xml
):
<converter module="import_converters"></converter>
The import_converters.py file (Adapter Management > Resources pane > Packages> External_source_import > Scripts) contains a set of the most commonly needed converters and types:
-
toString
-
stringToInt
-
stringToLong
-
stringToFloat
-
stringToBoolean
-
stringToDate
-
stringToDouble
-
skipSpaces
-
binaryIntToBoolean
-
stringToBytesArray
-
stringToZippedBytesArray
Example of a Converter
A CSV file contains the following row:
Usain, 21, Male
This row must be mapped to the Person CIT that includes name (Usain
), age (21
), and gender (Male
) attributes. The age
attribute should be of type integer. Therefore, the string in the CSV file must be converted to an integer in the CIT to make it compliant with the CIT attribute type, before the Person CIs can retrieve the age
values.
This is done by adding a converter element to the map element:
<map> <attribute>age</attribute> <column>2</column> <converter module="import_converters">stringToInt</converter> </map>
module="import_converters". This attribute specifies from which module the converter is to be retrieved. A module is a Jython script file that contains a set of converter methods, in this case, import_converters.py
.
stringToInt. The name of the converter. In the import_converters.py
file, the method is written as follows:
def stringToInt(value): if value is not None: return int(value.strip()) else: return 0
Custom Converters
You can write your own custom converters: Add a new method to the import_converters.py
file or create your own script and add a set of converter methods to it. Call the method with the name of the script, for example:
<converter module="your_converter_script">[your_converter_method]
</converter>