+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 19 of 19
  1. #11
    Super Member
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2015
    Join Date
    Nov 2013
    Posts
    1,215

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by rlx View Post
    Thanx for the update and the advice , always appreciated and never too old to learn
    No worries, always happy to help out back.

  2. #12
    Super Member
    Computer Details
    ronjonp's Computer Details
    Operating System:
    Windows 10
    Using
    AutoCAD 2018
    Join Date
    Apr 2009
    Location
    Colorado
    Posts
    595

    Default

    Quote Originally Posted by dilan View Post
    Thank you.This is what you need. How can I do not to delete all the files .txt in the "Temp" folder? For example I need to delete the file 123.txt and 321.txt...
    You only need to delete 2 files? Or do these files always consist of 3 numbers in the name?

  3. #13
    Forum Newbie dilan's Avatar
    Discipline
    Civil
    Using
    Civil 3D 2017
    Join Date
    Jan 2018
    Location
    From North
    Posts
    5

    Default

    Quote Originally Posted by ronjonp View Post
    You only need to delete 2 files? Or do these files always consist of 3 numbers in the name?
    Not always. Changed plans. In the "Temp" folder I have a folder "Stpr". I need to delete all files .txt in the folder "Stpr".
    The names of the deleted files can be different, but the file extension is always one - is .txt

  4. #14
    Super Member rlx's Avatar
    Computer Details
    rlx's Computer Details
    Operating System:
    W10
    Computer:
    i74ghz/ssd500/2tbhdd
    Discipline
    Electrical
    rlx's Discipline Details
    Occupation
    electrical designer dragon
    Discipline
    Electrical
    Details
    I dont excel in anything but I rearly give up
    Using
    AutoCAD 2016
    Join Date
    Nov 2014
    Location
    Bergen op Zoom , Netherlands
    Posts
    670

    Default

    Quote Originally Posted by dilan View Post
    Not always. Changed plans. In the "Temp" folder I have a folder "Stpr". I need to delete all files .txt in the folder "Stpr".
    The names of the deleted files can be different, but the file extension is always one - is .txt

    Good luck with that one Ronjonp

  5. #15
    Super Member
    Computer Details
    ronjonp's Computer Details
    Operating System:
    Windows 10
    Using
    AutoCAD 2018
    Join Date
    Apr 2009
    Location
    Colorado
    Posts
    595

    Default

    Quote Originally Posted by dilan View Post
    Not always. Changed plans. In the "Temp" folder I have a folder "Stpr". I need to delete all files .txt in the folder "Stpr".
    The names of the deleted files can be different, but the file extension is always one - is .txt
    Try this:
    Code:
    (defun c:foo (/ tmp)
      ;; Deletes "*.txt" files in temp\stpr dir!
      (foreach x (vl-directory-files (setq tmp (strcat (getenv "temp") "\\STPR\\")) "*.txt")
        (vl-file-delete (strcat tmp x))
        (print (strcat "DELETING >> " tmp "\\" x))
      )
      (princ)
    )
    (vl-load-com)

  6. #16
    Super Member
    Computer Details
    ronjonp's Computer Details
    Operating System:
    Windows 10
    Using
    AutoCAD 2018
    Join Date
    Apr 2009
    Location
    Colorado
    Posts
    595

    Default

    Quote Originally Posted by rlx View Post
    Good luck with that one Ronjonp
    Thankfully it's an easy change

  7. #17
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    19,408

    Default

    One-liner with a batch file...
    Code:
    del %temp%\STPR\*.txt
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  8. #18
    Forum Newbie dilan's Avatar
    Discipline
    Civil
    Using
    Civil 3D 2017
    Join Date
    Jan 2018
    Location
    From North
    Posts
    5

    Default

    Thanks ronjonp. That's what I need

  9. #19
    Super Member
    Computer Details
    ronjonp's Computer Details
    Operating System:
    Windows 10
    Using
    AutoCAD 2018
    Join Date
    Apr 2009
    Location
    Colorado
    Posts
    595

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by dilan View Post
    Thanks ronjonp. That's what I need
    Glad to help

Similar Threads

  1. Replies: 5
    Last Post: 25th Jun 2014, 05:20 pm
  2. LISP Folder Directory and Hyperlink
    By Ohnoto in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 29th Sep 2013, 01:50 pm
  3. Using vl-directory-files to populate list box
    By lfe011969 in forum AutoLISP, Visual LISP & DCL
    Replies: 15
    Last Post: 11th Aug 2010, 07:30 pm
  4. How to copy a list of files from one directory to another?
    By MarcoW in forum AutoLISP, Visual LISP & DCL
    Replies: 13
    Last Post: 7th Mar 2010, 03:37 pm
  5. Opening Files from same directory?
    By Ste1978 in forum AutoCAD Drawing Management & Output
    Replies: 1
    Last Post: 31st May 2006, 12:51 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts