.csv 导入错误你好
这里是新的 JMP 用户。 我只是尝试从 .csv 导入数据,但收到此错误:
.csv 中的原始数据如下所示:

有谁知道发生了什么事吗?
回复:.csv 导入错误并得到一个稍微好一点的答案
// make a CSV file with nuls in a field
filename = savetextfile("$temp/nuls.csv",chartoblob("a,b,c~0D~0A1.1,~00~00~00,1.2~0D~0A2.1,~00~00~00,2.2"));
// load the file into a blob so we can clean it up
blobdata = loadtextfile(filename,blob);
// convert the blob to text so we can manipulate the nuls as ~00
textdata = blobtochar(blobdata);
write("\!nbefore = ", textdata);
// fix it up, convert nul to SYMBOL FOR NULL (U+2400)
// https://www.fileformat.info/info/unicode/char/2400/index.htm
// replace ~00 with three byte UTF-8 sequence for a printable character
substitute into(textdata,"~00","~E2~90~80");
write("\!n after = ", textdata);
// convert it back to a blob, handling the ~0D and ~0A that remain
repairedblobdata = Char To Blob(textdata, "ascii~hex");
// at this point, you could save it (like above) or open it from memory:
dt = open(repairedblobdata,"text"); // tell JMP to interpret the blob as a CSV text file
the diagonal NUL is a single Unicode characterthe diagonal NUL is a single Unicode character对角线 NUL 是单个 Unicode 字符
真的很难谈论真正的 nul 字符,它不会打印并且往往会破坏东西,而可打印字符 2400 不是 ~00,但显示了一个漂亮的图形,表明它可能是 ~00。 我现在会把字体变小。
回复:.csv 导入错误是的,nul 字符是一个问题。 这是一个可能的解决方法:
// make a CSV file with nuls in a field
filename = savetextfile("$temp/nuls.csv",chartoblob("a,b,c~0D~0A1.1,~00~00~00,1.2~0D~0A2.1,~00~00~00,2.2"));
// load the file into a blob so we can clean it up
blobdata = loadtextfile(filename,blob);
// convert the blob to text so we can manipulate the nuls as ~00
textdata = blobtochar(blobdata);
write("\!nbefore = ", textdata);
// fix it up, convert nul to space
substitute into(textdata,"~00"," ");
write("\!n after = ", textdata);
// convert it back to a blob, handling the ~0D and ~0A that remain
repairedblobdata = Char To Blob(textdata, "ascii~hex");
// at this point, you could save it (like above) or open it from memory:
dt = open(repairedblobdata,"text"); // tell JMP to interpret the blob as a CSV text file
JMP 字符串限制为 2GB,因此如果您有非常大的文件,这将不起作用。
回复:.csv 导入错误这是 blob 的显示内容:
在 Notepad++ 中它们显示为 NULL 字符


回复:.csv 导入错误如果您有 JMP 14,请尝试使用多文件导入。
您可以使用它来查看文件并查看十六进制的问题字符
blob = loadtextfile("$Downloads\data_LCS.csv",blob(readlength(1000)));
write(char(blob));
字符到 Blob("Q1~09Q2~09Q3~09Q4~09Q5~09Q6 ...
如果上面的 1000 足够长以包含条形码值,则会告诉我们有关数据的更多信息。 在此示例中,~09 是分隔字段的制表符。
回复:.csv 导入错误它成功导入 Excel,并且将条形码读取为空白。 我可以将其另存为 Excel 文件,然后将其导入到 JMP 中,但如果可能的话,我希望避免该步骤,因为有一大堆数据文件,而且我将来将使用实时数据。

回复:.csv 导入错误我在下一页找到了它。 我看看是否可以设置为“字符”。 注意:如果我排除此列,则似乎排除了其后的每个数据单元格。 就像它在第一个条形码值后面看不到逗号一样。


回复:.csv 导入错误感谢马克的建议。
我已经继续使用文本导入向导。 我已经尝试了所有不同的字符集,但它们似乎都没有帮助。 此外,该向导似乎没有办法仅更改一个特定列的字符集。 还有另一种方法可以做到这一点吗? 似乎在第一个条形码值之后进行划分时出现问题。

回复:.csv 导入错误问题显然是条形码值。
使用文本导入向导而不是默认设置。 将条形码列的数据类型更改为字符,看看它是否可以更好地读取文件。 首先,我们将所有数据放入一个表中。 然后我们就可以考虑如何处理条形码了。