How to read multiple files at different directories using a
single Sequential File stage in DS Enterprise Edition

Answer Posted / venkat

To read given number of files, one can use follow below
steps:
1. In the sequential file stage, Use Read Method as
Specific File(s).
2. Now in the file text field, Put below command.
`ls /* | head -<Number of files to be read>`

This will read given number of files.

For example, I had 5 files, with similar pattern (as
date*.txt), in working folder say "/data/working/". If we
want to read three files out of these five files, one can
use following command:
`ls /data/working/date*.txt | head -3`

Hope this helps.


venkat
09940692102

Is This Answer Correct ?    0 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is ibm datastage flow designer?

925


What is orabulk stage?

866


Have you have ever worked in unix environment and why it is useful in datastage?

935


how to delete one row in target dataset

2873


What is the different type of jobs in datastage?

750


What steps should be taken to improve Datastage jobs?

846


What are the steps required to kill the job in Datastage?

973


Have you used Unstructured data?

1081


What is the difference between an operational datastage and a data warehouse?

901


how to abort the job its matain duplicates?

2368


what is flow of project?

1778


what is stage is used for below Input columns: dept|mgr|employee|salary Output columns: mgr|count of employee per mgr|avg salary per dept note: each dept has one mgr and each mgr has many employees

879


How can we perform the 2nd time extraction of client database without accepting the data which is already loaded in first time extraction?

2130


AGGREGATOR default datatype

1182


What are the types of jobs we have in datastage?

900