Page 1 of 2

Unable to open csv file format

Posted: Tue Jun 27, 2006 5:44 am
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

Posted: Tue Jun 27, 2006 5:56 am
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.

Posted: Tue Jun 27, 2006 6:17 am
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

Posted: Tue Jun 27, 2006 6:27 am
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.

Posted: Tue Jun 27, 2006 6:31 am
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.

Re: Unable to open csv file format

Posted: Tue Jun 27, 2006 6:38 am
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

Posted: Tue Jun 27, 2006 6:55 am
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

Re: Unable to open csv file format

Posted: Tue Jun 27, 2006 6:57 am
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? :?

Posted: Tue Jun 27, 2006 7:07 am
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?

Posted: Tue Jun 27, 2006 7:40 am
by chulett
Sorry James, but it's 009 for a tab. :wink:

Posted: Tue Jun 27, 2006 7:44 am
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:

Posted: Tue Jun 27, 2006 7:50 am
by chulett
Bond, James Bond. 007.

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

Posted: Tue Jun 27, 2006 7:52 am
by DSguru2B
hehe, your funny Craig. Still no word from the OP on whats going on :roll:

Posted: Wed Jun 28, 2006 2:00 am
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.

Posted: Wed Jun 28, 2006 2:04 am
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.