dpw63348 2017-03-31 18:41
浏览 674

使用包含数据换行符的文本字段将CSV导入MySQL Workbench

Tried loading csv from a spreadsheet into MySQL Workbench using a solution found here

LOAD DATA LOCAL INFILE '/path/to/your/csv/file/model.csv' INTO TABLE test.dummy FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '
';

The data loaded but some cells in the spreadsheet already contain new line characters. In these cases the LOAD created a new record.

Mathematics Kindergarten,Counting,"Say the number sequence 0 to 1000 forward and backward by:
- 5s, 10s or 100s, using any starting point 
- 3s, using starting points that are multiples of 3
- 4s, using starting points that are multiples of 4
- 25s, using starting points that are multiples of 25."

With a Table Like in this format:

 Course   |   Topic    | Description

The data loaded like so:

Mathematics Kindergarten   |    Counting    | "Say the number sequence 0 to 1000 forward and backward by:
- 5s, 10s or 100s, using any starting point              |                | 
- 3s, using starting points that are multiples of 3      |                | 
- 4s, using starting points that are multiples of 4      |                | 
- 25s, using starting points that are multiples of 25."  |                | 

How can I have the system recognize to load the data so that the whole cell contains the full description and it's not broke over X records.

  • 写回答

1条回答 默认 最新

  • dongqing7789 2017-04-02 11:08
    关注

    The steps had me return to the document that I exported the CSV. I had to sanitize the data.

    Find and Replace Carriage Returns and Newline Character present in cells with . Also found some other cells that had comma , into html number ,

    This corrected the issues with the data import tool of MySQL Workbench.

    评论

报告相同问题?

悬赏问题

  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等
  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行