我有一个txt文件,其中包含带引号,逗号分隔的文本,我正在尝试找出正在使用的换行符类型。
原因是因为我试图将它导入mysql服务器,使用本地infile,显然我需要告诉它正确的LINES TEDINATED BY
当我使用\ n或\ r \ n时,它只输入一半的记录,每次都跳过一行。
但是当我使用\ r时,它会导入两倍的精确行数,因为所有值都为null,因为它有记录。
当我在记事本中打开文件时,行之间没有空格,但是,如果我在浏览器中打开它,每行之间都有一个空行,好像某处有一个段落。同样明智的是,如果我选择“打开并使用> Excel”,它不会放入列中,并且每个列之间都有一个空行。在excel中正确打开的唯一方法是使用“获取外部数据>从文本”并选择逗号分隔符。
我只是通过复制和粘贴提供下面几行,显然如果有人能让我知道用于导入的正确设置会很棒。但是我会更好的,如果有一种方法可以让我快速了解任何特定文件使用的换行符类型(在文件的最末端按照其他行也有一个空行)。 / p>
"Item No.","Description","Description 2","Customers Price","Home stock","Brand Name","Expected date for delivery","Item Group No.","Item Group Name","Item Product Link (Web)","Item Picture Link (Web)","EAN/UPC","Weight","UNSPSC code","Product type code","Warranty"
"/5PL0006","Drum Unit","DK-23","127.00","32","Kyocera","04/11/2013","800002","Drums","http://uk.product.com/product.aspx?id=%2f5PL0006","http://s.product.eu/products/2_PICTURE-TAKEN.JPG","5711045360824","0.30","44103109","","3M"
"/DK24","DK-24 Drum Unit FS-3750","","119.00","8","Dell","08/11/2013","800002","Drums","http://uk.product.com/product.aspx?id=%2fDK24","http://s.product.eu/products/2_PICTURE-TAKEN.JPG","5711045360718","0.20","44103109","","3M"