Can DataStage search for a Pattern of Files in Sub-Direcotor
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 24
- Joined: Fri Oct 28, 2011 10:55 am
Can DataStage search for a Pattern of Files in Sub-Direcotor
Hello Everyone,
I have a scenario, In the Input folder we will have dynamic sub folders with XML Files. My questions is How can we read those xml files in the dymaic sub folders.
Ex: input/061212/ ---this has 15 files
input/0613/12/ -- this has 20 files
I want to read all these 35 files from Datastage.
and the sub-folder names will change dynamically may be for every 1hour or so..
Thanks
I have a scenario, In the Input folder we will have dynamic sub folders with XML Files. My questions is How can we read those xml files in the dymaic sub folders.
Ex: input/061212/ ---this has 15 files
input/0613/12/ -- this has 20 files
I want to read all these 35 files from Datastage.
and the sub-folder names will change dynamically may be for every 1hour or so..
Thanks
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Since we're talking XML consumption here, I'm assuming the goal is to collect the various filenames so the file path can be passed to an XML Input stage where it will do the actual reading of the contents.
Yes, no, maybe so? If that's the case then off the top of my head I'd say perhaps a "find" command in an External Source stage?
Yes, no, maybe so? If that's the case then off the top of my head I'd say perhaps a "find" command in an External Source stage?
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Premium Member
- Posts: 24
- Joined: Fri Oct 28, 2011 10:55 am
-
- Premium Member
- Posts: 24
- Joined: Fri Oct 28, 2011 10:55 am
I used the Find command to print all the XML files in the sub directories and redirect that output to a textfile and from that text file I am able to read those XML files too. BUT Any one can tell me the Move command to move those files that are present in the text file??
text files content
/IIS/data/Source/wra.xml
/IIS/data/Source2/from.xml
.
.
I want to move these files in the text file to go to another directory
text files content
/IIS/data/Source/wra.xml
/IIS/data/Source2/from.xml
.
.
I want to move these files in the text file to go to another directory
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
There's no single command, but you can write a shell script or DataStage sequence to loop through the file a line at a time reading the line and effecting the mv command.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Premium Member
- Posts: 24
- Joined: Fri Oct 28, 2011 10:55 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 24
- Joined: Fri Oct 28, 2011 10:55 am
How to do that! While i was writing to database how can i move the files from source to archive directory!!
Example: If my source file has 10 absolute paths:
iis/data/f1/1.xml
iis/data/f2/2.xml
while loading the 1.xml into the database how can we move the same file at the same time to another location!!
Example: If my source file has 10 absolute paths:
iis/data/f1/1.xml
iis/data/f2/2.xml
while loading the 1.xml into the database how can we move the same file at the same time to another location!!
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 24
- Joined: Fri Oct 28, 2011 10:55 am