Page 1 of 1

reading date from the file name

Posted: Tue May 19, 2009 10:33 am
by ravi_etl
Hi,

I have a file to process that file has a filename as filename_date.csv
I need to pass that date in the job is there anyway to do this.
If so please let me know.


Thanks

Posted: Tue May 19, 2009 10:49 am
by chulett
Please explain precisely what "I need to pass that date in the job" means.

Posted: Tue May 19, 2009 11:50 am
by dsedi
chulett wrote:Please explain precisely what "I need to pass that date in the job" means. ...
:)
ravi_etl wrote:Hi,

I have a file to process that file has a filename as filename_date.csv
I need to pass that date in the job is there anyway to do this.
If so please let me know.


Thanks
In Sequential file stage you have "fileNameColumn" property.
Read the help available.

Code: Select all

Adds a VarChar (Unicode for NLS installs) column to the output that contains the name of the file that the record is sourced from. User must add this column definition to the output columns to prevent it from being dropped if runtime column propagation is unchecked
from this,you can strip the value to get the date.

Re: reading date from the file name

Posted: Tue May 19, 2009 11:51 am
by vrishabhsagar
ravi_etl wrote:Hi,

I have a file to process that file has a filename as filename_date.csv
I need to pass that date in the job is there anyway to do this.
If so please let me know.


Thanks
Do you need to parse out the date from the filename? You want to do that using a sequence? job? or script?

Posted: Tue May 19, 2009 12:10 pm
by chulett
I asked because I'm not that much into guessing what the problem or question might be anymore, and would prefer people learn how to ask for help.

:idea: Always make sure your question / issue is clear and you've attempted to provide enough information so that (ideally) people can get right to the 'solving' part and we don't end up with multiple back-and-forth exchanges for clarifications or chasing of the wild geeses.