2010-02-05 52 views
0

有問題我確定有人遇到過某個地方的人。我們一直在將客戶的.csv文件傳輸到我們的筆記本電腦,然後將它們加載到我們的Oracle數據庫中,但是網絡使它成爲一個緩慢的過程。我設置了一個shell腳本,將這些文件LFTP文件下載到Solaris數據庫, sqlload他們 - 更快。有一些人物問題,所以我能夠改變NLS_LANG,現在看到DB中的字符與我們走窗口路線時相同。這7個文件中的2個存在問題。在500,000條記錄中,有幾千個被寫入.bad文件,因爲行被拆分。好奇的是,在Windows環境中,這沒有發生。不知道這是一個FTP與LFTP的事情,還是進入UNIX時發生的字符集轉錄(MSWIN - > WE8ISO)。也許有一個設置變量可以用來使LFTP在這方面更像FTP。 ...有任何想法嗎?.csv文件問題與分裂線在UNIX中,而不是Windows

我的創可貼替代方法如果我無法弄清楚上面的真實問題,請在將分割線重新操作回到上一行的末尾後重新加載2 .bad文件。以下是.bad文件中的分割記錄示例。他們似乎總是在這個地址字段分裂,很多時候,那裏應該是一個點或一個逗號 - 看到有在「215聖」換行:

"","","1-1000035","","","1-1000035","SIS STRATEGIC INFORMATION SYSTEMS","SIS STRATEGIC INFORMATION SYSTEMS","","RESELLER","Active","N","Y","","","","","","$" 
,"","","","","","","","80","","","","","","","","","","","","","(403) 281-4252","(780) 701-4050","North America","","","11432 215 St 
Summerbarn Rd","","","Edmonton","AB","T2S3Y5","Canada","","","","","","1-1000035","","","","","","","","","","","","", 
"","","","","",,,,"",,0,"UPSERT",10,"Y","Inserted By Widget",2009-10-23 15:08:03.387000000,2009-10-23 15:08:03.387000000,"",,"",,"","","1-1000035"^M 

回答

0

難道Unix和Windows之間的區別行結尾(\ n與\ r \ n)?

+0

試圖將它扼殺在萌芽中,可以這麼說,並且可以使LFTP xfer像FTP xfer一樣,如果它在這些協議之間而不是在字符之間。 – Ryan 2010-02-05 23:26:11