Not able to read .XLS file from DS

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
tanaya.deshpande@tieto.co
Participant
Posts: 94
Joined: Sun Jul 18, 2010 11:35 pm

Not able to read .XLS file from DS

Post by tanaya.deshpande@tieto.co »

HI

I have changed the extention of the .xls file to .csv ..but still I am not able to read the file thru Sequential file stage ..
is there any thing else I need to do..may in format tab..

Thanks
tanaya.deshpande@tieto.co
Participant
Posts: 94
Joined: Sun Jul 18, 2010 11:35 pm

Post by tanaya.deshpande@tieto.co »

My .xls file with changed extension .csv is present in unix box..
I am not able to view it thru cat command also
abhilashnair
Participant
Posts: 284
Joined: Fri Oct 13, 2006 4:31 am

Post by abhilashnair »

Just by changing the extension, the file format does not change. You need to read the data either as fixed width or delimited file in the sequential file stage.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Actually, you need to "Save as" your xls file to another format - .csv, .txt, .prn for example - before you transfer it to your UNIX system. Then you'll be able to read it with the Sequential File stage.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ajay.vaidyanathan
Participant
Posts: 53
Joined: Fri Apr 18, 2008 8:13 am
Location: United States

Not able to read .XLS file from DS

Post by ajay.vaidyanathan »

Hi,
Is your flatfile Delimited or Fixed? Cause if you are modifying your file extension alone, you will not impact the delimiter within the file.

For your delimiter also to be changed you need to manually open your file and change it or have some perl script called through unix and modify the delimiter first and then try using that file in your job.
Regards
Ajay
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

The .xls format (Excel spreadsheet) is a proprietary layout and not generic like .csv. You cannot easily process it directly using a sequential file stage as it also contains formatting information, formulas and other non-data items. As Craig suggested, you (or the data provider) need to save it (from Excel) as a .csv file which should then contain only the data itself. Then you can read it with sequential file stage.

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The alternative is to find a UNIX-based ODBC driver for Microsoft Excel and use ODBC. There are some restrictions, for example the worksheet must be in tabular format with column headings.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply