oos Posted June 20, 2012 Posted June 20, 2012 i have .txt file i want the lisp find "autocad" replace with "\n autocad" Quote
MSasu Posted June 20, 2012 Posted June 20, 2012 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. Quote
oos Posted June 20, 2012 Author Posted June 20, 2012 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 Quote
MSasu Posted June 20, 2012 Posted June 20, 2012 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... Quote
oos Posted June 20, 2012 Author Posted June 20, 2012 where is the input like "\\geodb\f\1.txt" where to save it "\\geodb\f\2.txt" it should take my txt file Quote
MSasu Posted June 20, 2012 Posted June 20, 2012 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. Quote
ReMark Posted June 20, 2012 Posted June 20, 2012 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. Quote
oos Posted June 20, 2012 Author Posted June 20, 2012 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 Quote
ReMark Posted June 20, 2012 Posted June 20, 2012 Now we've switched topics again to a lisp that generates a longitudinal sections. Quote
oos Posted June 20, 2012 Author Posted June 20, 2012 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) Quote
MSasu Posted June 20, 2012 Posted June 20, 2012 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. Quote
oos Posted June 20, 2012 Author Posted June 20, 2012 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.) Quote
pBe Posted June 20, 2012 Posted June 20, 2012 Microsoft word Ctril+H Find: Autocad Replace with: ^lAutocad Quote
pBe Posted June 20, 2012 Posted June 20, 2012 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? Quote
oos Posted June 20, 2012 Author Posted June 20, 2012 i have no downloading option, or instalation Quote
pBe Posted June 20, 2012 Posted June 20, 2012 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? Quote
oos Posted June 20, 2012 Author Posted June 20, 2012 lisp in txt.file (like .lsp extention) you supply past i run here Quote
oos Posted June 20, 2012 Author Posted June 20, 2012 lisp in txt.file (like .lsp extention) you supply past i run here i download outside Quote
Recommended Posts
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.