You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Importing and Exporting CSV Files while changing their formatting in Telerik SpreadProcessing
3
-
description: Learn how to handle culture settings, delimiters, and decimal separators while importing and exporting CSV files in Telerik SpreadProcessing.
3
+
description: Learn how to handle culture settings, delimiters, decimal separators, and date formats while importing and exporting CSV files in Telerik SpreadProcessing.
4
4
type: how-to
5
5
page_title: Changing Formatting While Importing and Exporting CSV Files in SpreadProcessing
6
6
meta_title: Changing Formatting While Importing and Exporting CSV Files in SpreadProcessing
@@ -12,22 +12,13 @@ ticketid: 1700417
12
12
13
13
## Environment
14
14
15
-
<table>
16
-
<tbody>
17
-
<tr>
18
-
<td> Product </td>
19
-
<td> SpreadProcessing for Telerik Document Processing </td>
I want to import a CSV file and export its values to another CSV file while applying specific formatting during the process. I need to account for culture settings and delimiters during both import and export operations to ensure the desired formatting results.
21
+
This article shows how to import a CSV file and export it with different formatting (delimiters, decimal separators, and date formats) back to CSV. You need to account for culture settings and delimiters during both import and export operations to ensure the desired formatting results.
31
22
32
23
This knowledge base article also answers the following questions:
33
24
- How to change culture settings during CSV import/export in SpreadProcessing?
@@ -36,12 +27,22 @@ This knowledge base article also answers the following questions:
36
27
37
28
## Solution
38
29
39
-
To import and export a CSV file with custom formatting, follow these steps:
30
+
Example input data (*a comma (",") as the delimiter and a dot (".") as the decimal separator*):
40
31
41
-
1. Set the culture settings to English (en-EN) and the delimiter to a comma (",") for importing the CSV file.
42
-
2. Import the CSV file using the `CsvFormatProvider` and parse the workbook.
43
-
3. Switch the culture settings to German (de-DE), the delimiter to a semicolon (";"), and apply the desired formatting.
44
-
4. Export the formatted workbook to a new CSV file.
To import and process the input file correctly you must:
39
+
* Set the **Delimiter** property of the [CsvFormatProvider Settings]({%slug radspreadprocessing-formats-and-conversion-csv-settings%}) to a comma (",")
40
+
* Set the [culture]({%slug radspreadprocessing-features-setting-the-culture%}) to English ("en-EN"), since its default decimal separator is a dot (".") and must match the file decimal separator
41
+
42
+
Once the document is imported and parsed, you can:
43
+
* Switch to a culture that has a comma (",") as its default decimal separator (e.g German - "de-DE")
44
+
* Set a new [Number Format]({%slug radspreadprocessing-features-number-formats%}) with a comma ("#,##") to the number values
45
+
* Set the **Delimiter** property of the [CsvFormatProvider Settings]({%slug radspreadprocessing-formats-and-conversion-csv-settings%}) to a semicolon (";")
-[Formatting Cells in SpreadProcessing](https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/features/cells/formatting-cells)
0 commit comments