Providing the name of a file (for reading or writing) dynamically
Sometimes, you don't have the complete name of the file that you intend to read or write in your transformation. That can be because the name of the file depends on a field or on external information. Suppose you receive a text file with information about new books to process. This file is sent to you on a daily basis and the date is part of its name (for example, newBooks_20100927.txt
).
Getting ready
In order to follow this recipe, you must have a text file named newBooks_20100927.txt
with sample book information such as the following:
"Title","Author","Price","Genre" "The Da Vinci Code","Dan Brown","25.00","Fiction" "Breaking Dawn","Stephenie Meyer","21.00","Children" "Foundation","Isaac Asimov","38.50","Fiction" "I, Robot","Isaac Asimov","39.99","Fiction"
How to do it...
Carry out the following steps:
Create a new transformation.
Drop a Get System Info step from the Input category into the canvas. Add a new field named
today
...