Jump to content

Lsp For find and replace the text with Excel (Or .txt file) input file


Recommended Posts

Posted

final ques...Attribute Text Possible to Include??

 

(list '(0 . "TEXT,MTEXT,ATTRIBUTE")

  • Replies 32
  • Created
  • Last Reply

Top Posters In This Topic

  • Tharwat

    12

  • suryatry26

    10

  • BIGAL

    3

  • djkenmm

    3

Posted

No an attribute is a sub entity of a "Insert" You would need a if/cond and new sub routine to handle blocks.

  • 5 months later...
Posted

Guys, instead of selecting an excel file, how can i make it to search or load a specific excel file (with specific path) automatically

Posted
Guys, instead of selecting an excel file, how can i make it to search or load a specific excel file (with specific path) automatically

 

Just replace the codes that represents the dialog with your complete Excel file path and be careful to have two back slashes or one forward slash .

 

I mean this code:

(setq fl (.......))

 

With this uncomplete example as per your complete path:

 

(setq fl "C:\\......"))
or this:
(setq fl "C:/......."))

Posted

Hi Tharwat,

Thanks for the quick response.

I dont know really how to deal with it, but i did try and i got bad argument when i execute the command.

 

 

(if (and (setq fl "U:/test/Book1.csv")
     )
   (progn
     (defun _parse:strings (string delimiter / pos lst)
;;; Parse a string to a list of strings    ;;;

Posted

Good try actually. :)

 

A little mods ...

 

 (if (and (setq fl "U:/test/Book1.csv") 
                  (setq on (open fl "r"))
                 ) 
            (progn .............

Posted

Wow! Thanks Tharwat! it works now! Thank you very much for the quick assistance!:D

Posted
Wow! Thanks Tharwat! it works now! Thank you very much for the quick assistance!:D

You are most welcome :)

  • 3 years later...
Posted

Hi Tharwat,

what a brilliant lisp. works very well.

 

was just wondering if it is a simple change in code so the .csv file your lisp reads into cad can be a ,(comma) delimited file rather than a ; (semicolon) 

I have just used the find and replace command within a comma delimited file to date. was just thinking it might be a simple fix to streamline the command.

Thank You in advanced.

and thank you again for sharing knowledge.

Posted

Not sure which bit of code you refer to but (defun _parse:strings (string delimiter / pos lst) the variable delimeter her can be what you choose so (_parse:string a,b,c,d,f ",")

Posted
8 hours ago, CADSURVEY said:

Hi Tharwat,

what a brilliant lisp. works very well.

 

was just wondering if it is a simple change in code so the .csv file your lisp reads into cad can be a ,(comma) delimited file rather than a ; (semicolon) 

I have just used the find and replace command within a comma delimited file to date. was just thinking it might be a simple fix to streamline the command.

Thank You in advanced.

and thank you again for sharing knowledge.

 

Hi,

Thank you for the nice words and I am happy that my program worked for you.

Regarding to your question, so just replace the semicolon in the following codes to comma.

eg: ( ";" to be "," )

(_parse:strings st ";")

 

 

 

 

 

 

  • 7 months later...
Posted
On ‎2‎/‎25‎/‎2015 at 5:13 PM, suryatry26 said:

Its Working Superb. Thanks a Lot..It Wont Work With MTEXT??? Possible to Include MTEXT?

can you pleas upload  CSV file ...

Posted
On ‎2‎/‎25‎/‎2015 at 5:20 PM, Tharwat said:

 

Finally you got it working ! good for you ;)

You can add the Mtext objects , just add the following part as shown in red color .

 

 


'(0 . "TEXT[color=red],MTEXT[/color]")
 

 

hi!! can you please upload CSV file .......

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...