How do you read a filename and substring it to variables
Posted: 05 Oct 2011 11:58
I am very new to DOS programming but have been doing Unix for a while.
This may sound a very basic problem to the experts, so please excuse my naivity.
Heres the problem -
Say I have 500 files in a folder with their file names in 1-12345-12345678 format. I got to read each file names to a single variable and pass it on to a pl/sql script. The pl/sql script will then update a table on sql server based on this variable (one of the columns of the table is a primary key based on this file name).
My questions are -
1. How do i read each file name to a variable in my batch script and then run it into a loop for as many files as present. (basically executing the pl/sql script as many times as there are number of files).
2. How do i pass the variable to the call for executing the pl/sql script from my batch script.
I appreciate your time and inputs on this and Thanks in advance for any response.
Thanks,
Sanders.
This may sound a very basic problem to the experts, so please excuse my naivity.
Heres the problem -
Say I have 500 files in a folder with their file names in 1-12345-12345678 format. I got to read each file names to a single variable and pass it on to a pl/sql script. The pl/sql script will then update a table on sql server based on this variable (one of the columns of the table is a primary key based on this file name).
My questions are -
1. How do i read each file name to a variable in my batch script and then run it into a loop for as many files as present. (basically executing the pl/sql script as many times as there are number of files).
2. How do i pass the variable to the call for executing the pl/sql script from my batch script.
I appreciate your time and inputs on this and Thanks in advance for any response.
Thanks,
Sanders.