I couldn't catch the point: when I try to read an easy csv-dataset with ";" as delimiter, I get only "strings" instead of a set of columns. Here are two lines of the csv-File:

k_id;started;created;code;kogtest_1_txt; 1;12.11.2018 - 09:03;12.11.2018 - 09:05;123456789;abc;

This Import-Statement data = Import["csvData.csv", Delimiter -> ";"] leads to {{"k_id;started;created;code;kogtest_1_txt;"}, {"1;12.11.2018 -
09:03;12.11.2018 - 09:05;123456789;abc;"}}

a List with two rows and one column with "strings" in it.

Any idea?

  • 1
    $\begingroup$ Aside: That is not a CSV file. $\endgroup$ – Alan Feb 25 at 20:47
  • 1
    $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$ – Michael E2 Feb 26 at 2:49
  • $\begingroup$ Hi Alan. Why isn't this file CSV? Because of the delimiter? Your link mentioned "in addition, the term "CSV" also denotes several closely related delimiter-separated formats that use other field delimiters". For me, a txt file with a delimiter between columns, is a CSV-File. $\endgroup$ – DaMaSt Feb 27 at 3:36

Question answered in this post.

Use this code:

Import["C:\\file.csv", "Table", "FieldSeparators" -> ";"]
  • $\begingroup$ Unbelievable.....FieldSeparators: why such a name? $\endgroup$ – DaMaSt Feb 25 at 20:31
  • $\begingroup$ It works, thanks a lot FieldSeparator will not be $\endgroup$ – DaMaSt Feb 25 at 20:32
  • $\begingroup$ But: it is a hidden feature: Mathematica don't know this option in "autofill" $\endgroup$ – DaMaSt Feb 25 at 20:33
  • $\begingroup$ It's not under CSV format options but in the Table format Documentation $\endgroup$ – Ben Izd Feb 25 at 21:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.