This is a migrated thread and some comments may be shown as answers.

CSV export with semicolon as field delimiter instead of a comma.

13 Answers 2899 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Development
Top achievements
Rank 1
Development asked on 10 Mar 2011, 04:03 PM
Hi,

When exporting a report to CSV it used a comma as field delimiter but I would like to use a semicolon instead. I did not find a way to change the delimiter. The documentation gives some hope as it  states: "The default field delimiter string is a comma (,)." , so there should be a way to use a non-default delimiter instead. Does anyone know the trick?

Regards,

Daniel


13 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 15 Mar 2011, 07:50 PM
Hi Daniel,

Changing the CSV delimiter is not possible in the current version. We would research if there is a way to present the option to change the delimiter used for the CSV export and if feasible, would implement this for subsequent versions of the product.

All the best,
Peter
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Development
Top achievements
Rank 1
answered on 16 Mar 2011, 09:13 AM
Hi Peter,

Thanks for your reply. We are shipping our software to Germany where the standard field delimiter is a semicolon (also see wikipedia article on CSV). Is it possible to get around with this (in the current version) by triggering a post-process step after the CSV is generated, so that I can replace the comma values by semicolon afterwards?

Please keep me updated on your research for adding this functionality in subsequent versions of the product.

Daniel
0
Steve
Telerik team
answered on 18 Mar 2011, 03:27 PM
Hi Daniel,

The specifics of the CSV rendering format are listed in the Design Considerations for CSV Rendering help article. Customizations like the one you describe are not supported.
Still you can either:

Kind regards,
Steve
the Telerik team
0
Alcide Burato
Top achievements
Rank 1
answered on 02 May 2011, 05:23 PM
Hello.
any news regards this issue? is it possible to export to csv using the local system setting for the List Delimiter?

thanks
Alcide
0
Massimiliano Bassili
Top achievements
Rank 1
answered on 03 May 2011, 09:26 AM
I would have to agree with Telerik on this one. Their CSV export is exactly by specifications and changing the delimiters results in different format e.g. for Germany where the decimal separator is a comma and the value separator is a semicolon, the format is called SSV (semicolon-separated values). Read more about it in http://en.wikipedia.org/wiki/Comma-separated_values.

Cheers!
0
Development
Top achievements
Rank 1
answered on 03 May 2011, 10:04 AM
Hi all,

Apart from whether Telerik is exactly following the mentioned description we --as a customer-- are in need of this quite common functionality (to be able to change the field delimiter in order to serve our German customers). Strange enough does Telerik provide this functionality in their other products, e.g. see their RadGrid help page: http://www.telerik.com/help/aspnet-ajax/grid-csv-export.html which shows how to configure this functionality:
<ExportSettings> <Csv ColumnDelimiter="Tab" RowDelimiter="NewLine" FileExtension="TXT" EncloseDataWithQuotes="true" /> </ExportSettings>

I would like to see similar config functionality in the report export but it is not yet provided by the reporting engine. In my opinion it should not be complicated for them to add this functionality anyway but it does not seem to have priority.

Regards,

Daniel

0
Alcide Burato
Top achievements
Rank 1
answered on 03 May 2011, 10:08 AM
Hi Massimilano,

unfortunately there's million of customers that are using MS Excel where files with ".csv" extension are opened parsing it using the semicolon as delimiter instead of the comma. For this reason, because Microsoft does'nt respect the CSV standard, Telerik have to give the opportunity to change the List Separator Character if Telerik desires to be more competitive.

The standard stuff are really good thing but when the reality differs from the standard it is better to open the mind if you want to survive in this hard sick world ;o)

I'm temporarily solving this problem using regular expression to replacing the comma with semicolon on the output csv file, but I'd like one day to have this functionallity managed directly from telerik exporting engine.

string origSeparator = "\",\"";
string destSeparator = "\";\"";
 
StreamWriter sw = new StreamWriter(destFileName, true);
using (StreamReader sr = new StreamReader(origFileName))
{
 String line;
 while ((line = sr.ReadLine()) != null)
 {
   sw.WriteLine(Regex.Replace(line, origSeparator, destSeparator));
   sw.Flush();
 }
}
sw.Close();


Best regards,
Alcide
0
Steve
Telerik team
answered on 12 Oct 2011, 08:20 AM
Hi guys,

You would be happy to know that in Q2 2011 SP1 we've added the ability to specify the field delimiter in CSV. Two new CSV Device Information Settings have been introduced due to this: FieldDelimiter and Qualifier. For more information refer to the latter article.

Greetings,
Steve
the Telerik team

Q2’11 SP1 of Telerik Reporting is available for download (see what's new). Get it today.

0
Grigore Dolghin
Top achievements
Rank 1
answered on 09 Jan 2012, 01:07 AM
Hi
I need to change the delimiter to tab character. However I couldn't find the documentation on how to do that. I have set the FieldDelimiter = "\t", but I got the literal \t in the exported csv. Tried "Tab", got this: "2Tab4142132000TabTab7.00Tab21.00Tab21.00Tab22.26"

Can anyone tell me what's the correct syntax?

Thanks
0
Steve
Telerik team
answered on 09 Jan 2012, 02:27 PM
Hello Grigore,

The Tab representation in XML is &#009; so you should set that as value i.e.:

<Telerik.Reporting>
    <Extensions>
      <Render>
        <Extension name="CSV">
          <Parameters>
            <Parameter name="FieldDelimiter" value=" " />
          </Parameters>
        </Extension>
      </Render>
    </Extensions>
  </Telerik.Reporting>

Greetings,
Steve
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

0
Grigore Dolghin
Top achievements
Rank 1
answered on 09 Jan 2012, 03:48 PM
EDIT: Please disregard my answer, it works if I add the code like this:

<Parameters>
            <Parameter name="FieldDelimiter" value="&#009;"/>
            <Parameter name="NoHeader" value="true"/>
            <Parameter name="NoStaticText" value="true"/>
</Parameters>

(The code you posted was helpful and misleading at the same time because the forum had replaced the &#009; with a space and I thought you're suggesting me to add an actual TAB character in the app.config. All is good now, thank you).
=========================================================

Hi, thanks for answering. Unfortunatelly, that's no go. I am using spaces instead of tabs in editor, so the tab character gets replaced with 4 spaces. Although I could temporarily allow spaces and enter that character then disable the tabs again, I will have to be very careful to not touch that file again, otherwise the tab will get replaced again, even without me knowing it.

I will live with this, but please implement a "\t" or "Tab", or whatever, but something that can't be changed accidentally. Or, maybe, add a "Text file (tab delimited)" in export options list....

Thank you.
0
Autolog
Top achievements
Rank 1
answered on 29 Jul 2014, 08:39 AM
I don't understand why it doesn't just use current culture, or, at the very least, the culture provided in the export options: CultureInfo.CurrentCulture.TextInfo.ListSeparator?
0
KS
Top achievements
Rank 1
answered on 31 Jul 2014, 09:03 AM
Hi,

If it is taken from the current culture it cannot be changed if you need to follow a format presentation for all machines running the app. The culture info can be used with the ReportProcessor.RenderReport and the deviceInfo.

-KS
Tags
General Discussions
Asked by
Development
Top achievements
Rank 1
Answers by
Peter
Telerik team
Development
Top achievements
Rank 1
Steve
Telerik team
Alcide Burato
Top achievements
Rank 1
Massimiliano Bassili
Top achievements
Rank 1
Grigore Dolghin
Top achievements
Rank 1
Autolog
Top achievements
Rank 1
KS
Top achievements
Rank 1
Share this question
or