How to create text on txt file w/o space

Discussion in 'AutoCAD' started by Adesu, Feb 4, 2005.

  1. Adesu

    Adesu Guest

    How to create text on txt file by autolisp,with result without space,here
    sample

    Newsgroups "Autodesk.autocad.customization".
    The newsgroup for autocad users in the world

    not like that

    Newsgroups "Autodesk.autocad.customization".

    The newsgroup for autocad users in the world
     
    Adesu, Feb 4, 2005
    #1
  2. Adesu

    Alaspher Guest

    Try this:
    Code:
    (if (/= (setq MyOutputString (vl-string-trim " \t\n" MyOutputString)) "")
    (write-line MyOutputString descriptor)
    )
    Good luck!
     
    Alaspher, Feb 4, 2005
    #2
  3. Adesu

    Adesu Guest

    Perfect !,hi Alaspher thanks a lot.
     
    Adesu, Feb 4, 2005
    #3
  4. Adesu

    Adesu Guest

    Hi Alaspher,how to reduce space in one line or (see attach)

    07/10/2005 FL MCB 0007 HOT CODING
    MACHINE

    I want

    07/10/2005 FL MCB 0007 HOT CODING MACHINE


     
    Adesu, Feb 4, 2005
    #4
  5. Adesu

    Alaspher Guest

    Hi, Adesu!
    Use vl-string-translate like code below:
    Code:
    (if (/= (setq MyOutputString
    (vl-string-trim
    " \t\n"
    (vl-string-translate "\n" " " MyOutputString)
    )
    )
    ""
    )
    (write-line MyOutputString descriptor)
    )
    Good luck!
     
    Alaspher, Feb 4, 2005
    #5
  6. Adesu

    Adesu Guest

    Hi Alaspher,not yet change,still same as before.
     
    Adesu, Feb 4, 2005
    #6
  7. Adesu

    Alaspher Guest

    What does your output string look like? Or you want change it into the text-file, may be?
     
    Alaspher, Feb 4, 2005
    #7
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.