Skip to content

Commit

Permalink
Excel multi-cell import: only split on real newline
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirdock committed Aug 19, 2021
1 parent 3d11ea6 commit 7b731fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions DataTableConverter/Assisstant/ImportHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -758,18 +758,18 @@ private void LoadSheet(IExcelDataReader reader, string fileName, List<string> he
if (reader.GetColumnWidth(i) != 0 || Properties.Settings.Default.UnhideColumns)
{
string value = trimOperation(GetFormattedValue(reader, i)).Replace("\t", string.Empty);
string[] multiCells = value.Split(new char[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
string[] multiCells = value.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
if (multiCells.Length > 1)
{
for (int j = 0; j < multiCells.Length; ++j)
{
AddMultiCellColumn(newHeaders[index], j, tableName, values, multiCells[j]);
AddMultiCellColumn(newHeaders[index], j, tableName, values, multiCells[j].Replace("\r", string.Empty));
}
insertCommand = null;
}
else
{
values.Add(newHeaders[index], value);
values.Add(newHeaders[index], value.Replace("\r", string.Empty));
}
index++;
}
Expand Down
2 changes: 1 addition & 1 deletion DataTableConverter/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.8.0")]
[assembly: AssemblyFileVersion("1.0.9.0")]

0 comments on commit 7b731fe

Please sign in to comment.