浏览代码

Fix putting too many value separators in CSV

ghorsington 5 年之前
父节点
当前提交
f47f6afcb0
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      ArcToolkitCLI/Commands/Converters/NeiConverter.cs

+ 4 - 4
ArcToolkitCLI/Commands/Converters/NeiConverter.cs

@@ -73,11 +73,11 @@ namespace ArcToolkitCLI.Commands.Converters
                     var cols = br.ReadUInt32();
                     var rows = br.ReadUInt32();
 
-                    var strLengths = new int[cols * rows * 4];
+                    var strLengths = new int[cols * rows];
 
                     for (int cell = 0; cell < cols * rows; cell++)
                     {
-                        br.ReadInt32(); // Total length of all strings
+                        br.ReadInt32(); // Total length of all strings because why not
                         strLengths[cell] = br.ReadInt32();
                     }
 
@@ -96,13 +96,13 @@ namespace ArcToolkitCLI.Commands.Converters
                             for (int col = 0; col < cols; col++)
                             {
                                 sw.Write(values[row * cols + col]);
-                                sw.Write(ValueSeparator);
+                                if(col != cols - 1)
+                                    sw.Write(ValueSeparator);
                             }
                             sw.WriteLine();
                         }
                     }
                 }
-
             }
 
             return 0;