.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 導入錯誤問題顯然是條碼值。
使用文字導入精靈而不是預設設定。 將條碼列的資料類型變更為字符,看看它是否可以更好地讀取檔案。 首先,我們將所有資料放入一個表中。 然後我們就可以考慮如何處理條碼了。