Message 1 of 5
Not applicable
07-30-2018
04:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi!
I've a CSV file whose each line is a list of attributes I have to insert in a determinate block. This is one example:
| Name | Value 1 | Value 2 | Value 3 | |
| Name | Value 1 | Value 2 | Value 3 | Value 4 |
| Name | Value 1 | Value 2 |
Let me explain: Block's type is given at the first column and the remainder columns are the attribute values I've to read. Not every type of block have the same number of attributes...
I've done something like that:
setq f (open "C:\\Users\\User\\Documents\\MyCSV.csv" "r")) (while (setq txtline(read-line f)) (princ txtline) (princ "\n") )
And I get txtline as a String similar to: Name;Value 1;Value 2;Value 3 and so on. Now, What I need is split this string and convert it into a list so my final list must be equal to this (for the first row): (list "Name" "Value 1" "Value 2" "Value 3")
I don't know how to do this. I belive it's a simple task but I can't do it
Thank you
Solved! Go to Solution.