Hi All,
I am getting files with file names consists of fund name and date. I have to pass this fundname and date as invocationId to the application. We are getting dynamic number of source files and the application needs to be executed with DSJobInvocationId.
Eg:F*****-FundTest_Euro-20071115.csv
Here F***** is the fund number and 20071115 is the date.
I need to pass (F*****-20071115) as ds job invocation Id for that particular file execution.
Please give me some inputs for this.
How to pass name & Date as invocation Id from file name
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Hi Sainath,
I know how to specify invocationId in sequence as well as script but how can take this mentioned invocation id from the file name. The file name consists of name and date.
I am getting 100 source files and I have to pass these names as invocation id's.
I hope you understand now.
I know how to specify invocationId in sequence as well as script but how can take this mentioned invocation id from the file name. The file name consists of name and date.
I am getting 100 source files and I have to pass these names as invocation id's.
I hope you understand now.
Sainath.Srinivasan wrote:Are you calling from the sequencer or shell script.
If it is from the sequencer, you will get an additional text box for invocation id.
If it is from shell script, suffix the invocation id after ...
Thanks
Vijay
Vijay
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Hi Vijay,
Try the below commands to read all file names from the directory (i hope all files are present at same location)
1) ls -lrt | awk '{ print $9}' :- Using awk
2) ls -lrt | tr -s ' ' | cut -d ' ' -f9 :- Using cut command
You can take the output of the above command to a file and you can easily pass file name one by one to your job.
Hope this will work.
Try the below commands to read all file names from the directory (i hope all files are present at same location)
1) ls -lrt | awk '{ print $9}' :- Using awk
2) ls -lrt | tr -s ' ' | cut -d ' ' -f9 :- Using cut command
You can take the output of the above command to a file and you can easily pass file name one by one to your job.
Hope this will work.
Thanks in Adv.
Ashish
Ashish