We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

CSV format - Remove Double Quotes

Thread ID:

Created:

Updated:

Platform:

Replies:

76801 Sep 24,2008 04:36 PM UTC Sep 25,2008 12:38 PM UTC ASP.NET Web Forms (Classic) 1
loading
Tags: XlsIO
Vidya Jayakumar
Asked On September 24, 2008 04:36 PM UTC

Hi,

I am Saving data coming from database -> into a Datatable then importing into a
worksheet and saving it in CSV format.
I am actually saving the file in MapPath first and opening a dialog box and
having user save it whereever they want to.

the code looks like this:-

Protected Sub btn_Import_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn_Import.Click
excelEngine = New ExcelEngine()
appl = excelEngine.Excel
workbook = appl.Workbooks.Create(3)
Dim strpath1 As String = Server.MapPath("Import")
Comments:-GetDataToCSVFile()
Method call is very simple in selecting 4 columns from a sql table and out of it 3 are varchar columns and one is int-:Comments
Dim mycsvdatatable As DataTable = GetDataToCSVFile()
sheet = workbook.Worksheets(1)
sheet.ImportDataTable(mycsvdatatable, False, 1, 1)
sheet.SaveAs(strpath1 & "\" & "Sample.csv", ",", Encoding.ASCII)
Comments:-Opens a dialog box to
save-:Comments

Response.Redirect("~\Import\" & "Sample.csv", False)
End Sub

Attached CSV file has Text/varchar columns (Columns B,C,D in attached file) in Quotes.As i mentioned above 3 columns they are enclosed in Double Quotes in CSV file. May i know Why? Is there any way to remove them via Sync's save as() method

In another example for CSV file i got from your forums:-
I see the format to save the file is different- there is no encoding parameter?
workbook.SaveAs(Server.MapPath("sample.csv"),"/t");

Are the Double quotes due to saving format as Encoding.ASCII?

Regards,
Vidya



Sample_50df277f.zip

Geetha M [Syncfusion]
Replied On September 25, 2008 12:38 PM UTC

Hi Vidya,

Thank you for your continued interest in Syncfusion products.

I am afraid that I am not able to reproduce the problem. You can get the test sample I created based on the above code snippets in the below link:

http://websamples.syncfusion.com/samples/XlsIO.Web/6.3.1.8/I49986/main.htm

Please try running the above sample and let me know if you are able to see the problem at your end.

Also, I am able to see the problem only when I am not setting the Encoding as ASCII. So, could you please let me know the regional settings of your environment?

Regards,
Geetha


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;