0

Help! Access is importing wrong columns from a csv file. There are no commas in the csv and there should not be any spaces like (space)(space), but just (space). I'm ending up with '' in the SERIAL_NR header, but in the actual csv there are values.

enter image description here

This is giving me 1000 extra rows. Is there anything else to check for?

4

1 回答 1

1

这是偷偷摸摸的,但在一些单元格中包含了 alt+enter 字符 [chr(10)]。我使用以下 vba 代码来摆脱它。

sub cleaner()
Dim enterchar as string

enterchar = chr(10)

activesheet.usedrange.Replace What:=enterchar, Replacement:="", LookAt:=xlPart, _ 
SearchOrder:=xlByRows, MatchCase:=False 

end sub

准备 csv 以导入 Access 非常漂亮。我已经创建了一个用于清理 csv 的加载项(消除重复项、特殊字符等),如果有人有兴趣我会发布。

谢谢大家!

于 2013-05-31T18:56:06.700 回答