Jump to content

Recommended Posts

Posted

i have .txt file

i want the lisp

find "autocad"

replace with "\n autocad"

  • Replies 21
  • Created
  • Last Reply

Top Posters In This Topic

  • oos

    11

  • ReMark

    4

  • MSasu

    4

  • pBe

    3

Top Posters In This Topic

Posted

If is about an ASCII file, wouldn't be simpler to just edit it in Notepad? You have there a built-in Find-And-Replace feature.

Posted
If is about an ASCII file, wouldn't be simpler to just edit it in Notepad? You have there a built-in Find-And-Replace feature.

take txt as input and replace give it in other txt file

 

my text file is about 600 MB

 

in lisp it take less time

Posted

Then you should look to VL-STRING-TRANSLATE function.

(vl-string-translate "a" "b" "aqawaearatayaua")

But I’m not sure if AutoLISP interpreter will handle such huge amount of data...

Posted

where is the input like "\\geodb\f\1.txt"

where to save it "\\geodb\f\2.txt"

 

it should take my txt file

Posted

I’m not sure that understand. What had that code to do with the original discussion on find and replace issue?

Also, please edit your post to follow the rules to post code.

Posted

I thought you were trying to find and replace text?

 

Your last post looks more like you want to plot a drawing. Are you going to be batch processing a folder full of drawings? If the answer is "yes" then you might want to look into using a script.

Posted

there is lisp it take my .txt file data and generate longitudinal section like that

 

in the same way it take my txt file find the word "autocad" before "autocad" add newline autocad start in new para

Posted

Now we've switched topics again to a lisp that generates a longitudinal sections.

Posted

only command it not take my txt file,

i want my txt file to take take replace it in other txt file (i was explaining that)

Posted

Seems that the post with plot code excerpt was meantime edited.

I maintain my opinion that such processing will crash AutoCAD or even the workstation. If you are willing to develop the said function, then I suggest you to do the conversion on-the-fly; that it, open both source and destination files at the same time and read from one, replace strings and write to the second one.

 

Before writing a dedicated function for this task, may be useful to check the NotePad++ editor. It took ~3 minutes to replace "a" with "b" in a 25Mb text file.

Posted

in lisp only the command is there for new line like '\n' for tab like '\t'

in notepad we have no option to new line

new line means replace with what?

 

 

are there any lisp- like this-(that it, open both source and destination files at the same time and read from one, replace "new line" and write to the second one.)

Posted

Microsoft word

Ctril+H

Find: Autocad

Replace with: ^lAutocad

Posted
we have only autocad 2004

 

You can download Notepad++ oos.

 

Replace:

 

Find what: autocad

Replace with: \nautocad

 

Search mode:

Nornal:

Extneded: Tick mark

 

If you still cant do that, then we'll write a code. you cool with that?

Posted

i have no downloading option, or instalation

Posted
:unsure: You were able to go online and post a question here oos. Thats unfortunate ,Are you telling us if we attached a file here (say a lisp file), you wont be able to download the file?
Posted

lisp in txt.file (like .lsp extention) you supply past i run here

Posted
lisp in txt.file (like .lsp extention) you supply past i run here

i download outside

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...