Unplanned
Last Updated: 03 Feb 2026 15:35 by ADMIN
ADMIN
Deyan
Created on: 25 Apr 2016 18:22
Category: SpreadProcessing
Type: Feature Request
10
SpreadProcessing: Implement an option to import numbers as text from CSV
Currently, the numbers in a CSV file are parsed as numbers, and the leading zeros are lost. In MS Excel, leading zeros could be preserved when the values are imported as text using the more sophisticated text import wizard (http://www.upenn.edu/computing/da/bo/webi/qna/iv_csvLeadingZeros.html ).

Workaround: The values could be extracted using a third-party (or custom) CSV parser, and inserted manually into the model, using CellSelection.SetValueAsText method (http://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/working-with-cells/cell-value-types.html ).
6 comments
ADMIN
Yoan
Posted on: 03 Feb 2026 15:35

Hi Chris,

I completely understand your concern, and I apologize for the frustration this has caused.

At this time, the task has not been scheduled for implementation for the same reasons as before. We prioritize requests in our Feedback Portal based on several factors, including customer demand, technical complexity, available resources, and overall product direction.

I want to be transparent that it has not yet been planned for delivery. That said, your feedback is absolutely valid and valuable to us. I’ve made sure your continued interest and comments are visible to our product team so they understand and reevaluate the real-world impact of this gap. I’m sorry that I don’t have a definitive timeline to share, but we truly appreciate your patience and persistence.

If you’re able to share specific use cases or business impact details, they can genuinely help strengthen the request internally.

I am also sharing with you some potential workarounds you might find useful for your scenario:

Method 1

Adding the trailing zeroes after the file is imported

For example:

CsvFormatProvider provider = new CsvFormatProvider();
var workbook = provider.Import(File.ReadAllText("input.csv"));
var worksheet = workbook.Worksheets[0];

for (int i = 1; i < worksheet.UsedCellRange.RowCount; i++)
{
    var cell = worksheet.Cells[i, 0];
    var numberValue = cell.GetValue().Value as NumberCellValue;
    string newValue = ((long)numberValue.Value).ToString("D10");
    cell.SetFormat(new CellValueFormat("@"));
    cell.SetValue(newValue);
}
this.radSpreadsheet.Workbook = workbook;

This approach converts an integer to a string with at least 10 digits, padding with leading zeros if needed.

5 → "0000000005"
1234567890 → "1234567890"
-42  → "-0000000042"

Method 2

Extract the file data with a 3rd party CSV parser and then insert it manually into the model, using CellSelection.SetValueAsText. You can also read line by line from the CSV file and split the cell values by the delimiter.

NOTE: If you would like to avoid the default parsing of the input string and always produce a TextCellValue, you need to set the CellValueFormat of the cells to Text ("@") and then enter the values.

Method 3

Implement a custom format provider that fills the cells of the worksheet with the exact strings from the .csv file. To achieve this, you will need to implement the DelimitedValuesFormatProviderBase abstract class and override the ImportOverride() method. The Format Providers Manager help article describes how to register/unregister a format provider. Note that you should ensure that the format of the cell is set to Text before inserting the value.

Thank you again for your understanding and for sticking with us.

Regards,
Yoan
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Chris
Posted on: 29 Jan 2026 13:06

I've just been fighting this as well - I've been attempting to import a file which has numbers with padded zeros and the CSV parser thinks it's a number and strips them off, but I DO need those padded zeros.  Being able to import the file as-is should be the default with no additional processing (unless requested), or have the option to turn the processing off and have the parser treat EVERY cell as a string (which is what pretty much every other CSV importer does).

I know this original post is a few years old now, but I would have thought that 10 years later, it would have been implemented by now?  Is there any update on whether this has/will be implemented?

ADMIN
Yoan
Posted on: 12 Apr 2024 13:53

Hello Joshua,

First of all, thank you for the provided feedback, your efforts are much appreciated.

The way we operate is we have a system that prioritizes the logged tasks in our Feedback Portal by taking into consideration various factors like demand, complexity, resources, etc. We are doing everything in our power to answer customer requests and needs by resolving these tasks as fast as possible, but some receive less attention than others, which is why they can sometimes be delayed, just like this one.

Currently, this task is not on our roadmap for the foreseeable future and I also wouldn't want to mislead you by giving you any incorrect information just for the sake of it. Once any item is resolved, we immediately update the public feedback page to notify our clients so the best thing I can offer is to subscribe to the task in order to track its progress and don't miss potential updates.

For the time being the only alternative I can offer you is the potential workaround previously provided in this thread.

Thank you for your understanding. 

Regards,
Yoan
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Joshua
Posted on: 11 Apr 2024 15:54

Is there still no way to do this? This is stopping me from being able to import CSV files. It mangles my original data and i cannot deduce what it is.

 

I propose a simple setting that just imports everything as is and keeps it text.

var worksheetProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.TextBased.Csv.CsvFormatProvider();
worksheetProvider.Settings.ImportAllValuesAsText = true;

using var workBook = worksheetProvider.Import(csvData);
ADMIN
Aleks
Posted on: 04 May 2023 12:22

Hi Todd,

I am Aleks and I will be happy to assist with this case. From what I have gathered you have previously reported this unexpected behavior.
I am afraid this feature has not yet been implemented.

I apologize for the inconvenience this missing functionality may have caused.

We will note down all the information provided from your side in our internal item and will keep it in mind once the development of the feature has started.

I understand that the provided workaround is not working for your scenario. In that case you can continue following this public item on any updates.

Regards,
Aleks
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Todd
Posted on: 03 May 2023 12:28

I'd like a new configuration parameter added to CsvFormatProvider to treat all CSV data as strings.

I want it to behave like Microsoft.VisualBasic.FileIO - TextFieldParser.

(note that TextFieldParser has it's own parameters like TextFieldType, Delimiters, and HasFieldsEnclosedInQuotes).