Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • csv file-separating columns

    Hi all,
    I have around 1000 csv files and I need to import them into STATA - the columns are not separated and I need them to get separated. Can you suggest a way to separate them, so that they get separated both, when I open them in STATA and when I open them as a csv file on my laptop?
    Thanks,
    Ciara

  • #2
    Hi Ciara,

    We often suggest to people asking questions to follow the FAQ on asking questions. Please provide Stata code in code delimiters (CODE tags), readable Stata output, and sample data using dataex. Screenshots are not useful because they cannot be easily translated into something that people potentially willing to help can work with in Stata. Also, attaching files is discouraged due to possible concerns about viruses and malware.

    I'm not sure what you mean when you say that your columns are not separated. Can you show an example of what some of your input data look like (in code delimeters)? In either case, if you can open one file successfully, this will often be easy to wrap in a loop to import multiple files.

    Perhaps your CSV files have data organized in a fixed-width structure, which means that every variable has an assigned width (number) of characters, rather than using a comma, say, to indicate the separation of values. If this is the case, you may look at the output of -help infix-.

    Comment


    • #3
      thanks Leonardo, I have already sorted out the issue.

      Comment

      Working...
      X