read a line from csv from index 2 to the end of line
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello Reader
my question is in different parts so i am listing them out:
1) I have defined a function this way
(defun test ( str1 x y text1 text2) ---(a)
and then using this to insert
(command "_insert" str1 insertpt1 "" "" "" text1 text2) ---(b)
I want to pass a list instead of text1,text2, where 'text' is a list of strings
So if i am not wrong, I will modify (a) like this
(defun test ( str1 x y text)
How should I modify (b) ?
2) I am reading data from a csv file using Lee Mac's readcsv function
After (setq data (LM:readcsv file)), I am accessing each line of the csv like this:
(foreach line data ;; etc etc ---(c)
The csv looks something like this:
"A",34,35,"B","C","D"
"AA",42,46
"AAA",29,54,"BB","CC","DD","EE","FF"
What I am aiming for is:
for every element in 'line' (reference to (c)) if the index of element is greater than 2 then append it to a list, say 'textlist' [catering to corner case that list is empty]
How should go about doing that ?
3) Now I should be able to call the function test like this:
(test name (read p1) (read p2) textlist) ; ignore name, p1,p2. already read from csv
Please help me...