How to import csv data where some observations are on two rows

后端 未结 5 1314
别跟我提以往
别跟我提以往 2021-01-16 02:10

I have a dataset with a couple million rows. It is in csv format. I wish to import it into Stata. I can do this, but there is a problem - a small percentage (but still many)

5条回答
  •  抹茶落季
    2021-01-16 02:42

    I would try the following strategy.

    1. Import as a single string variable.
    2. Count commas on each line and combine following lines if lines are incomplete.
    3. Delete redundant material.

    The comma count will be

    length(variable) - length(subinstr(variable, ",", "", .)) 
    

提交回复
热议问题