Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Mon Feb 13, 2023 11:54 am

Hello,
I am trying to convert delimited .txt files into .xlsx but the output contains an inside space after each character.
Below is the code and attached you can find 2 sample files.

Thank you!

Tudor

static void Main(string[] args)
{
Stopwatch stopwatch = new Stopwatch();
stopwatch.Start();
DirectoryInfo dinfo = new DirectoryInfo(@"C:\Users\g17566\Desktop\Test Validation");
FileInfo[] Files = dinfo.GetFiles("*.txt");
foreach (FileInfo file in Files)
{
Workbook workbook = new Workbook();
workbook.LoadFromFile(file.FullName, "|");
Worksheet sheet = workbook.Worksheets[0];
CellRange usedRange = sheet.AllocatedRange;
usedRange.IgnoreErrorOptions = IgnoreErrorType.NumberAsText;
usedRange.AutoFitColumns();
usedRange.AutoFitRows();
workbook.SaveToFile(file.FullName.Replace(".txt","")+".xlsx", ExcelVersion.Version2013);

}
stopwatch.Stop();
TimeSpan ts = stopwatch.Elapsed;
string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}",
ts.Hours, ts.Minutes, ts.Seconds,
ts.Milliseconds / 10);
Console.WriteLine("RunTime " + elapsedTime);
Console.ReadLine();
}
Attachments
DEC_100_0400_BO1.zip
(61.46 KiB) Downloaded 441 times

tudor1985
 
Posts: 2
Joined: Mon Feb 13, 2023 11:41 am

Tue Feb 14, 2023 8:40 am

Hi,

Thanks for your inquiry.
I did a test with your code and document, I did reproduce your issue. I have logged this issue into our bug tracking system with the ticket number SPIREXLS-4468, our developers will investigate and fix it. Sorry for the inconvenience caused. Once the issue is fixed, I will inform you.

Sincerely,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Mon Feb 20, 2023 8:34 am

Hello,

Do you have any news or tips related to this topic?

Thank you!

Tudor

tudor1985
 
Posts: 2
Joined: Mon Feb 13, 2023 11:41 am

Mon Feb 20, 2023 9:11 am

Hi Tudor,

Thanks for your following-up.
I got news from our dev team, the issue SPIREXLS-4468 is going to the testing phrase, please spare us a little more time, once it passes the test, I will inform you of a new version asap. Thanks for your understanding.

Sincerely,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Wed Mar 15, 2023 10:42 am

Hi Tudor,

Thank you for your patience.
Glad to inform that we just released Spire.XLS Pack(Hotfix) Version:13.3.2 which fixed the issue of SPIREXLS-4468, welcome to test it.
Website link: https://www.e-iceblue.com/Download/download-excel-for-net-now.html
Nuget link: https://www.nuget.org/packages/Spire.XLS/13.3.2

Best Regards,
Herman
E-iceblue support team
User avatar

Herman.Yan
 
Posts: 115
Joined: Wed Mar 08, 2023 2:00 am

Return to Spire.XLS