Unable to open csv file format

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

vijayindukuri
Participant
Posts: 66
Joined: Fri Nov 25, 2005 7:55 am

Unable to open csv file format

Post by vijayindukuri »

Hi All,
We have source as Excel format and i converted the source excel file to test.csv format and tried to open the file and iam getting the following error

Code: Select all

test..Sequential_File_10.DSLink11: nls_read_delimited() - row 1, too many columns in record
and then i supressed row truncation warnings by ckecking but i can see the metadata which is not in redable format.
Can i know how to slove this problem.
Thanks in advance
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post by loveojha2 »

Actually there is a miss match between the number of columns within the csv file that you are using and the metadata of the sequential file stage that is used for running the csv file. Check whether the number of columns are same or not and check whether there is any possibility of having delimiters within the data of the csv file like an occurence of " within any of the columns data.
Success consists of getting up just one more time than you fall.
vijayindukuri
Participant
Posts: 66
Joined: Fri Nov 25, 2005 7:55 am

Post by vijayindukuri »

Hi loveojha2 ,
The number of columns remains same in the meta data of sequential file definition and the csv file.The csv file do not have any of " such delimiters.
When i try to open the csv file through sequential file stage I can see the meta data in un readable format.
Can you suggest some alternative or your way approach towards reading data from CSV files.
Thanks in advance
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

What do you mean when you say that metadata is in unreadable format? Could you elaborate on it. Also, if you can post a sample row from your .csv file it would be of more help. I'll take a shot in the dark. Assuming that your data in the .csv file is not quoted, suppress the quote character in the Sequential File stage i.e. set Quote character value to 000 and let us know if that works.
Kris

Where's the "Any" key?-Homer Simpson
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Maybe you are getting a comma in your data itself. Thats why the csv file is complaining for the extra column. Also, what exactly do you mean by meta data is not readable. How can you read the metadata from the file. Do you mean, while importing the metadata from the csv file your having problems, or its acting wierd. Need clarification.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
rwierdsm
Premium Member
Premium Member
Posts: 209
Joined: Fri Jan 09, 2004 1:14 pm
Location: Toronto, Canada
Contact:

Re: Unable to open csv file format

Post by rwierdsm »

Vijayindukuri,

Ensure that you have the Line Termination radio button set to DOS Style (CR LF).

If you have it set to UNIX Style, the file itself will have a line terminator of (x0D0A) but DS is expecting (X0A). DS thinks the (x0D) is an extra column.

Rob
Rob Wierdsma
Toronto, Canada
bartonbishop.com
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post by loveojha2 »

Open your csv file in a non xls editor like notepad, are you able to see your data properly there, somthing like:
dhkas,dfghkd,fjshjdks
sdhsj,sdhjs,dsjds
Success consists of getting up just one more time than you fall.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: Unable to open csv file format

Post by chulett »

vijayindukuri wrote:We have source as Excel format and i converted the source excel file to test.csv format
Ok, based on the garbage you are seeing, let's not make any assumptions here. Please explain how you 'converted' the excel file. Also, what does the .csv file look like if you open it in something simple like Notepad? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

woooo, thats martian language :? . Ok sorry guys, just messing in the morning.
Something seriously went wrong while converting it into a csv file.
Do this, dont save it in csv, save it in a tab delimited format, you have that option for xls files. In the sequential file stage, specify 007 in the delimiter box. See if that works.
Forget datastage, did you try opening the csv file just by double clicking on it. What do you see?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sorry James, but it's 009 for a tab. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

yea sorry, i knew i was off there, but was too lazy to open my job and look it up. Thanks Craig.
James huh... :?
I need to stop putting names in my quotes :wink:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Bond, James Bond. 007.

That was the 'James' reference... :lol:
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

hehe, your funny Craig. Still no word from the OP on whats going on :roll:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post by loveojha2 »

I have converted the xls file to csv file by renaming . This renaming is done by job sequence (Execute command stage)
That won't convert it to csv, go to your xls editor, do a save as and save it as a csv file format.
Success consists of getting up just one more time than you fall.
vijayindukuri
Participant
Posts: 66
Joined: Fri Nov 25, 2005 7:55 am

Post by vijayindukuri »

DS guru:
Forget datastage, did you try opening the csv file just by double clicking on it. What do you see?
After renaming the file i tried to view the file by double cliking that,I was able to see that data in csv format.
The problem comes when i try to see that from sequential file stage's view data.
Post Reply