Table of Contents

Search

  1. Preface
  2. Transformations
  3. Source transformation
  4. Target transformation
  5. Aggregator transformation
  6. Cleanse transformation
  7. Data Masking transformation
  8. Data Services transformation
  9. Deduplicate transformation
  10. Expression transformation
  11. Filter transformation
  12. Hierarchy Builder transformation
  13. Hierarchy Parser transformation
  14. Hierarchy Processor transformation
  15. Input transformation
  16. Java transformation
  17. Java transformation API reference
  18. Joiner transformation
  19. Labeler transformation
  20. Lookup transformation
  21. Machine Learning transformation
  22. Mapplet transformation
  23. Normalizer transformation
  24. Output transformation
  25. Parse transformation
  26. Python transformation
  27. Rank transformation
  28. Router transformation
  29. Rule Specification transformation
  30. Sequence Generator transformation
  31. Sorter transformation
  32. SQL transformation
  33. Structure Parser transformation
  34. Transaction Control transformation
  35. Union transformation
  36. Velocity transformation
  37. Verifier transformation
  38. Web Services transformation

Transformations

Transformations

File list commands

File list commands

You can use a command to generate a list of source files for a mapping. You can use a valid DOS or UNIX command, batch file, or shell script.
Data Integration
reads each file in the list when the task runs.
Use a command to generate a file list when the list of source files changes often or when you want to generate a file list based on specific conditions. For example, you can use a command to generate a file list from all files in a directory or based on the file names.
Use the following guidelines when you generate a file list through a command:
  • You must enter Windows commands that use parameters such as "/b" in a batch file.
  • You must enter fully qualified file paths in each command, batch file, and shell script.
  • You cannot use an in-out parameter for the file list command.

UNIX Example with Shell Script

You need to extract data from parts lists that are stored on a Linux machine. The parts lists are text files that are stored in the
/home/dsmith/flatfile/parts
directory.
The following table shows the command that you enter in the Source transformation and the contents of the corresponding shell script:
Command
Shell Script (parts.sh)
/home/dsmith/flatfile/parts/parts.sh
cd /home/dsmith/flatfile/parts ls *.txt

Windows Example with Batch File

You need to extract data from sales records that are stored on a Windows machine. The sales record files are stored in the
C:\SalesRecords
directory and use the naming convention
SalesRec_??-??-2017.txt
.
The following table shows the command that you enter in the Source transformation and the corresponding batch file contents:
Command
Batch File (SalesSrc.bat)
C:\SalesRecords\SalesSrc.bat
@echo off cd C:\SalesRecords dir /b SalesRec_??-??-2017.txt

Example without Shell Script or Batch File

You can also generate a file list through a command instead of through a batch file or shell script. For example, the following command generates a file list that contains one file named source.csv:
echo C:\sources\source.csv

0 COMMENTS

We’d like to hear from you!