Hi,
I need to read the data from excel ,and the excel will be placed in our server and with the timestamp, i need to get the latest excel and update oracle table. I m using Sequential file->Transformer->OCI
Now how do i know which is the latest excel in the server..?
please help me out.
Thanks.
Mohana Krishnan
Reading input from a sequential file
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 10
- Joined: Thu May 24, 2007 12:34 am
- Location: India
You will need one process to determine the correct file to use, then passing that value to the DataStage job that reads the file.
There are many ways of getting the "latest" file; it depends if you do it by date-time created/modified or by the name. This would be a single UNIX statement, i.e. "ls /test/path/TestSheet*.xls -ls | head -1"
There are many ways of getting the "latest" file; it depends if you do it by date-time created/modified or by the name. This would be a single UNIX statement, i.e. "ls /test/path/TestSheet*.xls -ls | head -1"
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
So you plan to put the Excel (.xls) file on a Unix machine? Good luck!!
Or is it a text dump (.csv or .txt file) that you plan to put on the Unix machine?
In either case you can work out which is the latest by checking the date/time accessed/modified, which the ls option suggested by ArndW uses to sort the file names. That's why a head -1 command selects the most recent.
Or is it a text dump (.csv or .txt file) that you plan to put on the Unix machine?
In either case you can work out which is the latest by checking the date/time accessed/modified, which the ls option suggested by ArndW uses to sort the file names. That's why a head -1 command selects the most recent.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 10
- Joined: Thu May 24, 2007 12:34 am
- Location: India
We are going o place .xls file in the unix path. I could not able to see all ur coments.ray.wurlod wrote:So you plan to put the Excel (.xls) file on a Unix machine? Good luck!!
Or is it a text dump (.csv or .txt file) that you plan to put on the Unix machine?
In either case you can work out whi ...
Thanks,
Mohana Krishnan
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Premium membership costs less than 30c (Rs12) per day. Among other things it will let you read the five premium posters' contributions in their entirety. All revenue from premium memberships is devoted to defraying hosting and bandwidth costs incurred by DSXchange so, by taking up premium membership, you are helping to keep DSXchange alive.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
You'd need to purchase and leverage UNIX drivers that can read Excel files. For example, an 'adapter' from someone like iWay Software. Otherwise you'll need to export the data, do a 'save as' in a sequential file format like the .txt or .cvs formats, which can be easily processed.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers