How to import csv file from sharepoint?

How to import csv file from sharepoint?

Anonymous
Not applicable
1,213 Views
10 Replies
Message 1 of 11

How to import csv file from sharepoint?

Anonymous
Not applicable

Hello,

 

I have a file in Sharepoint, a csv excel file with layers name, i need to import this to autocad to create layers list using lisp.

 

Help me.

0 Likes
1,214 Views
10 Replies
Replies (10)
Message 2 of 11

dbhunia
Advisor
Advisor

Check >>This<< how to import CSV file....... or give a sample.......

 

 


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
0 Likes
Message 3 of 11

Anonymous
Not applicable

Actually I dont want to give the path every time through dialogue box to read the csv file. I want to set the path of sharepoint only once. So every time if i run the lisp it should directly read the csv from same path. I will be keep updating the csv in sharepoint.

0 Likes
Message 4 of 11

dbhunia
Advisor
Advisor

Try this.......

 

(defun LM:readcsv ( csv / des lst sep str )
    (if (setq des (open csv "r"))
        (progn
            (setq sep (cond ((vl-registry-read "HKEY_CURRENT_USER\\Control Panel\\International" "sList")) (",")))
            (while (setq str (read-line des))
                (setq lst (cons (LM:csv->lst str sep 0) lst))
            )
            (close des)
        )
    )
    (reverse lst)
)
(defun LM:csv->lst ( str sep pos / s )
    (cond
        (   (not (setq pos (vl-string-search sep str pos)))
            (if (wcmatch str "\"*\"")
                (list (LM:csv-replacequotes (substr str 2 (- (strlen str) 2))))
                (list str)
            )
        )
        (   (or (wcmatch (setq s (substr str 1 pos)) "\"*[~\"]")
                (and (wcmatch s "~*[~\"]*") (= 1 (logand 1 pos)))
            )
            (LM:csv->lst str sep (+ pos 2))
        )
        (   (wcmatch s "\"*\"")
            (cons
                (LM:csv-replacequotes (substr str 2 (- pos 2)))
                (LM:csv->lst (substr str (+ pos 2)) sep 0)
            )
        )
        (   (cons s (LM:csv->lst (substr str (+ pos 2)) sep 0)))
    )
)
(defun LM:csv-replacequotes ( str / pos )
    (setq pos 0)
    (while (setq pos (vl-string-search  "\"\"" str pos))
        (setq str (vl-string-subst "\"" "\"\"" str pos)
              pos (1+ pos)
        )
    )
    str
)

 

Syntax.....

(setq Data_csv (LM:readcsv "CSV File path"))

or

(LM:readcsv "CSV File path")

 


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
0 Likes
Message 5 of 11

Anonymous
Not applicable

Thank you for your reply. I will try this one and tell you. Thanks one again 

0 Likes
Message 6 of 11

Anonymous
Not applicable

I just want to add a point that my file path will be something like: https://sp.....  hope it 

0 Likes
Message 7 of 11

dbhunia
Advisor
Advisor

You just run the line below in the command line.......

 

(getfiled "Select CSV File" "" "csv" 16)

 

and select the CSV file from the Dialog box ....... you will get path in your command line ...... use that as path:)

 

 


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
0 Likes
Message 8 of 11

ronjonp
Advisor
Advisor

Just a guess but you're probably going to have to download the file locally then read it. Some code HERE to do the download part.

Message 9 of 11

Anonymous
Not applicable

Good idea, i tried, i am getting nil @dbhunia 

0 Likes
Message 10 of 11

dbhunia
Advisor
Advisor

What message are you getting?

Are you getting Data, while you are using the LISP like below?.....

(setq Data_csv (LM:readcsv "CSV File path"))
or
(LM:readcsv "CSV File path")

 

How your path looks ........like "\\prt4a\SMG\Debashis\0000000.csv" or something else?

 

May be you should check the post as @ronjonp  said.....

 

Download the file & save to your local system.....& move as i said

 

 


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
0 Likes
Message 11 of 11

dgorsman
Consultant
Consultant

Or don't keep it in SharePoint.  Drawing files OK, documnets definitely.   But not data files.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


0 Likes