Need a special offer?Find out if your project fits.
+

"Input string is not in a correct format" using Flexmonster Compressor

Answered
Martin Torres asked on July 7, 2020

Hi,
We are using Compressor version 2.7.4 on ASP.NET, and got an error trying to compress an specific .csv file (attached). The error is: "Input string is not in a correct format", when executing inputStream.Read(buffer, 0, buffer.Length). We analized the file visually, pass it throw some csv validators and everything is ok. It seems that it brokes while being compressed, but the error doesn't specify why. Is there any way to get more specifications in this type of errors? Or any workaround to avoid that?

Thanks in advance
Best regards

2 answers

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster July 10, 2020

Hello,
 
Thank you for reaching out to us.
 
We assume the problem you are facing is connected with a data type mismatch in the "Marca" column. In case the data type is not explicitly specified, the Data Compressor identifies it using the first record in the data set. The provided CSV file contains a numeric value as a first occurrence of the "Marca" field. At the same time, the majority of values of the column belong to the "string" type. It leads to the exception you see.
 
Such a behavior can be avoided in case the data type is explicitly specified.
Please refer to our documentation in order to get more information about available data types and ways to define them.
For example, in order to mark the specific column as "string", it is enough to place the + sign right before the column's header:

+Marca

 
Please let us know if it helps.
Do not hesitate to contact us in case further assistance is required.
 
Regards,
Illia

Public
Martin Torres July 13, 2020

Hello Illia

That solved the problem. Thank you so much!

Regards

Please login or Register to Submit Answer