MJLM Posted February 24, 2014 Posted February 24, 2014 Would it be possible to have Autolisp read a txt file and delete all duplicate files? I know that doesn't require necessarily autolisp but the values in the file come from an Autolisp routine and I though I could integrate it so that I can have the file ready with not duplicates. Any ideas would be appreciated. Quote
Bhull1985 Posted February 24, 2014 Posted February 24, 2014 Yes, please look into the (vl-remove-if-not) functions. Here are a couple examples a quick google search turned up http://forums.augi.com/showthread.php?29269-Delete-Duplicate-Text-in-the-same-object http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/How-to-find-duplicate-text-string/td-p/1990898 (post following is from someone much smarter, I was just trying to be of assistance) Quote
MSasu Posted February 24, 2014 Posted February 24, 2014 If the content of said file comes from an AutoLISP routine, then may easily integrate a code to store the lines into a list and use MEMBER function to validate if a line isn't already there and therefore shoudn't be added again. Quote
MJLM Posted February 24, 2014 Author Posted February 24, 2014 MSasu thank you for letting me know the member command. It worked perfectly making as you said a list and use of member command. Thank you. Quote
MSasu Posted February 24, 2014 Posted February 24, 2014 Sound good MJLM; you're entirely welcome! One observation for the sake of conformity, is about a function and not a command. 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.