Page 1 of 1

Getting File Names

Posted: Wed Aug 23, 2006 2:37 am
by mali_aydin
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

Posted: Wed Aug 23, 2006 3:10 am
by ray.wurlod
I'm sure there's a property for this, but can't recall its name. Search the forum - you'll probably find it.

Posted: Wed Aug 23, 2006 5:04 am
by mali_aydin
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

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.

Posted: Thu Aug 24, 2006 5:21 am
by jhmckeever
Is this what you're looking for ...

viewtopic.php?t=96039

J.

Posted: Fri Aug 25, 2006 1:11 am
by ray.wurlod
That's the one. :D

Posted: Fri Aug 25, 2006 1:32 am
by mali_aydin
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





jhmckeever wrote:Is this what you're looking for ...

viewtopic.php?t=96039

J.