Hi,
While reading data from ascii files I want to get the file names at the same time
Definition of
Source : File Pattern = /export/home/dsadm/cdr/file_name*
Read Method = File Pattern
Example :
file_name1 : a,b,c,d,e,f
file_name2 : g,h,i,j,k,l
file_name3 : 1,2,3,4,5
I want to load records in "file_name1,file_name2,file_name3" files and the name of files at the same time.
Input : /export/home/dsadm/cdr/file_name*
Output : file_name1,a,b,c,d,e,f
file_name2,g,h,i,j,k,l
file_name3,1,2,3,4,5
Thanks In Advance
Best Regards
MAli
Getting File Names
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Charter Member
- Posts: 6
- Joined: Fri May 05, 2006 6:57 am
Thanks for your response but I have tried lots of things on Designer and read everthing written in this forum but unfortunately could not find anything solves my request. May be ascential will create patch for this request...
Best Regards
MAli
Best Regards
MAli
ray.wurlod wrote:I'm sure there's a property for this, but can't recall its name. Search the forum - you'll probably find it.
-
- Premium Member
- Posts: 301
- Joined: Thu Jul 14, 2005 10:27 am
- Location: Melbourne, Australia
- Contact:
<b>John McKeever</b>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Charter Member
- Posts: 6
- Joined: Fri May 05, 2006 6:57 am
Hi jhmckeever,
Unfortunately it is not the one I am looking for:((
First solution advice is related to the server job, but mine job is parallel and as far as I know there is no Folder option in PX.
Second solution could not solve it neither
In second solution it says : "The parallel sequential file stage has an optional Option called "File Name Column", it is a varchar column that outputs the name of the file that the record is sourced from. Don't know if it works for file patterns but let us know how it goes. "
But unfortunately it could not solve the problem, I am getting the files in folder and I write only the prefix of file name for example /dir/cdr/file_name* . When I use the file Name Column option it gets the "/dir/cdr/file_name*" not the filename itself.
I still could not find any solution, but hope that we will find in this forum
Best Regards
Unfortunately it is not the one I am looking for:((
First solution advice is related to the server job, but mine job is parallel and as far as I know there is no Folder option in PX.
Second solution could not solve it neither
In second solution it says : "The parallel sequential file stage has an optional Option called "File Name Column", it is a varchar column that outputs the name of the file that the record is sourced from. Don't know if it works for file patterns but let us know how it goes. "
But unfortunately it could not solve the problem, I am getting the files in folder and I write only the prefix of file name for example /dir/cdr/file_name* . When I use the file Name Column option it gets the "/dir/cdr/file_name*" not the filename itself.
I still could not find any solution, but hope that we will find in this forum
Best Regards