read all files from load directory
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 77
- Joined: Tue Apr 14, 2009 4:03 am
read all files from load directory
i have to read all file with file name from load directory.In each run number of file may vary.all files are fixed width length file.
say for example below are my files in load directory( may be in next run i will have more files)
1_20100311_171556.txt
2_20100311_171556.txt
3_20100311-171556.txt
4_20100311-171556.txt
5_20100311-171556.txt
please advice me how to read files in my job when i don't know the number of files which we have in load directory
say for example below are my files in load directory( may be in next run i will have more files)
1_20100311_171556.txt
2_20100311_171556.txt
3_20100311-171556.txt
4_20100311-171556.txt
5_20100311-171556.txt
please advice me how to read files in my job when i don't know the number of files which we have in load directory
-
- Participant
- Posts: 77
- Joined: Tue Apr 14, 2009 4:03 am
-
- Premium Member
- Posts: 892
- Joined: Thu Oct 16, 2003 5:18 am
Can you not try using a file pattern in the sequential file stage, which will also give you the file name as an additional column if you so desire.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 77
- Joined: Tue Apr 14, 2009 4:03 am
-
- Participant
- Posts: 77
- Joined: Tue Apr 14, 2009 4:03 am
in sequential file i have definedArndW wrote:Can you not try using a file pattern in the sequential file stage, which will also give you the file name as an additional column if you so desire. ...
file patern=#$LoadDir#\*.*
in option properties i have defined
file name column-xyz
now i have doubt..in column tabb do i need to define column
file name ?
details
actually i have defined only one column from which i am getting only record
In the sequential file properties tab, click on 'options' and you'll see that you have a property call 'File Name Column', activate that and choose the column name that you would like to use.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 77
- Joined: Tue Apr 14, 2009 4:03 am
hi ArndW ,ArndW wrote:In the sequential file properties tab, click on 'options' and you'll see that you have a property call 'File Name Column', activate that and choose the column name that you would like to use. ...
i have used 'File Name Column'=xyz.
but in output i am not getting my file name which i have in load directory(sample.txt)
in xyz column its returning load directory path .
please advice