Loading ...
Sorry, an error occurred while loading the content.

delimiters

Expand Messages
  • sharonklinect@ymail.com
    I am new to Libertybasic, how can I read (input) a txt file with space delimiters.
    Message 1 of 2 , Nov 1, 2012
    • 0 Attachment
      I am new to Libertybasic, how can I read (input) a txt file with space delimiters.
    • Gary Passmore
      The following code will print (or process, as you may wish to revise it, each word in the string input from a file. Note that word$(string$,index) can also
      Message 2 of 2 , Nov 1, 2012
      • 0 Attachment
        The following code will print (or process, as you may wish to revise it, each "word" in the string input from a file.
        Note that "word$(string$,index)" can also use other delimiters as "words(string$,index,"delimiter"). See the Help file for "WORD$(s$,n)"
        [startcode]
            filedialog "open","*.txt",file$
            open file$ for input as #file
            while eof(#file)=0
                line input #file,data$
                words=0
                while word$(data$,words+1)<>""
                    words=words+1
                    fileinput$=word$(data$,words)
                    print fileinput$ ' (OR WHATEVER YOU DESIRE DO DO WITH THE 'WORD')
                wend
            wend
            close#file
            end
        [endcode]
         


        ...from the world according to GaRPMorE


        ________________________________
        From: "sharonklinect@..." <sharonklinect@...>
        To: libertybasic@yahoogroups.com
        Sent: Thursday, November 1, 2012 5:44 PM
        Subject: [libertybasic] delimiters


         

        I am new to Libertybasic, how can I read (input) a txt file with space delimiters.




        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.