Reading SEQ Filename with a Date time

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
vskr72
Premium Member
Premium Member
Posts: 128
Joined: Wed Apr 28, 2004 9:36 pm

Reading SEQ Filename with a Date time

Post by vskr72 »

I have a file that is dropped a by a system which has the Timestamp attached to it in this format.

Code: Select all

FileName_YYYYMMDD_HHMMSS.txt
This file gets dropped into our system and we need to read it to load it into a table. Is there a way to read it without modifying the file name using any Unix commands. Thank you for your siuggestions.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sure, set the Read Method to 'File Pattern' and then supply the appropriate wildcard pattern to read the file. Yours could be "FileName_*.txt".
-craig

"You can never have too many knives" -- Logan Nine Fingers
vskr72
Premium Member
Premium Member
Posts: 128
Joined: Wed Apr 28, 2004 9:36 pm

Post by vskr72 »

Worked like charm.
pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

Post by pandeesh »

I remember,in one of the scenario, i need to get the file from remote server.In that case there i haves used wildcard and identified the file name. Then from the command activity i have passed the job name as parameter to the job.

In your case, you are getting the file in your local server means, Craig's solution sounds good.
pandeeswaran
Post Reply