+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Full Member
    Using
    AutoCAD 2010
    Join Date
    Oct 2015
    Posts
    67

    Default Another Text File Question

    Registered forum members do not see this ad.

    Sorry if this has been done before but...


    I have a few lines of text in a text file that I want to use in a LISP - how do I get them there?

    I reckon I can add a word or something in the text file to start where I want to copy and a word to end what I want to copy for example


    Startcopy
    Here is some text that
    I want to copy to use
    later
    endcopy


    startsecondtextcopt
    ...
    ...
    endsecondtextcopy




    There was a question he other day which I used for how to open a text file and read the whole contents to a variable but I want it to select just say, startcopy to endcopy above. Hope that makes sense so far.


    If possible some sort of array so element 1 is line 1 of the text, element 2 is second line... but there are an unknown number of lines.




    It would be great if you can help and point me in the right direction, thanks

  2. #2
    Full Member
    Using
    AutoCAD 2012
    Join Date
    Apr 2015
    Posts
    42

    Default

    Try vl-string-search this will give you the position of the text you are looking for. Then use substr to chop up your string

    Sent from my Pixel XL using Tapatalk

  3. #3
    Full Member
    Using
    AutoCAD 2010
    Join Date
    Oct 2015
    Posts
    67

    Default

    Registered forum members do not see this ad.

    Thanks Dan,. I'll try that today.

Similar Threads

  1. Replies: 9
    Last Post: 4th Jan 2016, 03:01 pm
  2. Lsp For find and replace the text with Excel (Or .txt file) input file
    By suryatry26 in forum AutoLISP, Visual LISP & DCL
    Replies: 27
    Last Post: 10th Aug 2015, 08:51 pm
  3. Replies: 17
    Last Post: 13th Jan 2015, 09:50 am
  4. LISP code getting text inside a text file
    By Ahmeds in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 27th Nov 2013, 03:04 am
  5. Export/import drawing file to/from csv(text) file
    By mtjipta in forum AutoCAD Drawing Management & Output
    Replies: 0
    Last Post: 9th Jan 2010, 04:14 am

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