hi
i want to read a file in unix server in monthly basis
the file name will be datard1.log,once the file is processed next file the data will be written
then in next month i want to read datard2.log file
datard1.log file will be in the same server
we have only read access to the server
based upon the modified date i have to read the file
file name will be same like datard....
but the number will be changing like
datard1.log
datard2.log
" .
" .
datard9.log
can this be done in datastage or in unix
if it can only done by unix can you give the script
thanks in advance
To read Unix log file
Moderators: chulett, rschirm, roy
Re: To read Unix log file
you will need to create a counter to keep track of the files alredy processed. you can create one in a table or in a file.
Checkout using ssh to run a directory listing on the unix server, then take the name of the desired file and pass it to an scp command to copy the file to your local DataStage server.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Re: To read Unix log file
Hi,
Try this script it should work
ls -t|tail -1 > newfile
Working
ls -t lists file by creation date, just check the order of listing
tail -1 will pick the last line, which I think will be the latest file, this is written into newfile.
Let me know if it worked
Try this script it should work
ls -t|tail -1 > newfile
Working
ls -t lists file by creation date, just check the order of listing
tail -1 will pick the last line, which I think will be the latest file, this is written into newfile.
Let me know if it worked