Page 1 of 1

Extracting Date part from File Name

Posted: Tue Aug 22, 2006 8:32 pm
by satheesh_color
Hai,

My file is in /cust/ris/dev/data/rwinbound/pos2/unfid_errors(Unix) verify that POS data has been processed for the file date and terminal id.

File Name : ras.dltx.postrn.20060719.070547.00002973

Date : 20060719 terminal id: 00002973--How to get the date and terminal id for each filename from unix to DS.

Then i have to check it with database for the particular file(By using date,terminal id) is processed or not.

If not processed then move the perticular file to process folder else no need.

Kindly give me your suggestions an how to achieve this.

Regards,
Satheesh.R

Re: Extracting Date part from File Name

Posted: Tue Aug 22, 2006 10:55 pm
by prabu
satheesh_color wrote:Hai,

My file is in /cust/ris/dev/data/rwinbound/pos2/unfid_errors(Unix) verify that POS data has been processed for the file date and terminal id.

File Name : ras.dltx.postrn.20060719.070547.00002973

Date : 20060719 terminal id: 00002973--How to get the date and terminal id for each filename from unix to DS.

Then i have to check it with database for the particular file(By using date,terminal id) is processed or not.

If not processed then move the perticular file to process folder else no need.

Kindly give me your suggestions an how to achieve this.

Regards,
Satheesh.R
try field function

Posted: Tue Aug 22, 2006 11:06 pm
by DSguru2B
If you can get a list of all the files present in the folder you want to manipulate then you can read it via a sequential file and then use the field function to extract the date and the terminal id. Otherwise you can use write a small script to read in the files and use the power of awk to get the date and terminal id which can then be read by DS.