Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Importing CSV file.

12 REPLIES 12
Reply
Message 1 of 13
chikito1990
25681 Views, 12 Replies

Importing CSV file.

Hi all!

I am trying to import a CSV file in AutoCAD 2014 but cannot find proper function. Is there any automatic function that will do it for me or I have to create some kind of tool to accomplish that task?


Thank you in advance.

 

Best regards,

Dimitar Georgiev

Tags (3)
12 REPLIES 12
Message 2 of 13
maxim_k
in reply to: chikito1990

Hi Dimitar,

 

How do you want to represent data from CSV file in AutoCAD:

- table

- points or polyline (3D polyline)

- any other?

 

Maxim


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
Message 3 of 13
chikito1990
in reply to: maxim_k

Hi Maxim,

 

Well I have table with X, Y possitions and also blocknames. So what i have to do is insert the bolock on the coresponding position.

 

Thank you.

Dimitar Georgiev

Message 4 of 13
maxim_k
in reply to: chikito1990

You need AutoLISP routine, or Script file to accomplish this.

Could uoy post your CSV file here?

(If it fail to attach to the post - just compress it in ZIP format and then attach to your post)

 

Maxim


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
Message 5 of 13
chikito1990
in reply to: maxim_k

 
Message 6 of 13
maxim_k
in reply to: chikito1990

Does your blocks contain attributes (I mean "Block label" in your CSV file)?
If yes - than converting CSV file to AutoCAD script may be bad idea.
Than you need AutoLISP routine, that reads CSV file line by line and executes INSERT command with parameters from each line.


Maxim

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
Message 7 of 13

Use Excel file to generate the script file and run the script to insert the blocks.
Assuming you have  a single attribute block and the insertion option for scale and rotation needs user input.

 

Find the attached Excel file and copy the highlighted rows information to a notepad file and save it as a script file.
Then run the script command.

 

Run_Script.JPG

Message 8 of 13
k.bedekar
in reply to: maxim_k

Hi, This is Kaustubh Bedekar from India.

 

I am a profetional trader in indian stock market. I receive every day a comma separated stock price data file in .txt format. I want to import this text file in to auto cad 2013.

 

I WANT TO VIEW THE IMPORTED DATA AS A STOCK CHART USING THE MITOTIC SCALING WHICH IS A BRIDGE JOINING CHARTS WITH GEOMETRICAL OVERLAYS.

 

Attaching a text file. 3 files

each file containing 1300 + share scrip

sample:-

name, date, open, high, low, close, volume, open intrest

BANKNIFTY-I,20160225,13801.1,13850,13541.25,13567.9,128616,1081020

 

I have almost 3900 text files. that means over 20 years of data of indian stock market.

 

Just like a Professionals use Meta Stock to analyse their price movement.

 

I want to use the data for resistances & supports.

 

 

autocad upload.jpg

 

I wanted to have a this kind of chart for every stock name. and further i will be able to do the geometrical analysis using the angular lines. snap shot below is the jpeg image imported & tried to explain what i want actully. 

 

autocad upload 1.jpg

 

 

Thanks in advance. all the best.

Message 9 of 13
martti.halminen
in reply to: k.bedekar

 

So what was your question?

 

Which part of this do you not know how to do?

 

You might start by reading http://www.catb.org/esr/faqs/smart-questions.html

 

-- 

 

Message 10 of 13
k.bedekar
in reply to: martti.halminen

I DONT KNOW ANY THIG OF IMPORTING TEXT FILES SO PLEASE HELP ME IMPORTING MY TEXT FILES IN TO AUTOCAD
Message 11 of 13
martti.halminen
in reply to: k.bedekar

(defun read-csv-file (path separator / f1 line result)
  ;; reads a csv file (separator as a one-character string) into a list, each line as a list
  (setq f1 (open path "r"))
  (while (setq line (read-line f1))
    (setq result
          (cons
           (split-at separator line)
           result)))
  (close f1)
  (reverse result))

(defun split-at (char str / pos  )
  ;; Splits string to a list of strings at each char occurrence.
  ;; Separators omitted from the result.
  ;; char as an one-character string.
  (setq pos (vl-string-position (ascii char) str))
  (cond
    ((or (null char) (null str)) nil)
    ((null pos) (list str))
    (T (cons (substr str 1 pos)
             (split-at char (substr str (+ 2 pos)))))))

-- 

 

Message 12 of 13
k.bedekar
in reply to: martti.halminen

WHAT DO I DO WITH THIS. I DONT UNDERSTAND IT
Message 13 of 13
martti.halminen
in reply to: k.bedekar


@k.bedekar wrote:
WHAT DO I DO WITH THIS. I DONT UNDERSTAND IT

As an out-of-the-box AutoCAD knows nothing about practically anything mentioned in your first message, you write a program around that to do the things you want.

- Or pay a professional programmer to do that. I know nothing about stock analysis, but as a first guess we would be talking about several weeks of full-time work.

 

-- 

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost