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

RE: [libertybasic] Reading file with carriage returns

Expand Messages
  • Jim Hiley
    This code reads the complete file into a string: open fileName$ for input as #1 txt$=input$(#1,lof(#1)) close #1 Jim ... From: libertybasic@yahoogroups.com
    Message 1 of 3 , Jul 25, 2013
      This code reads the complete file into a string:

      open fileName$ for input as #1
      txt$=input$(#1,lof(#1))
      close #1

      Jim


      -----Original Message-----
      From: libertybasic@yahoogroups.com [mailto:libertybasic@yahoogroups.com] On
      Behalf Of daveclow1
      Sent: Friday, 26 July 2013 06:53
      To: libertybasic@yahoogroups.com
      Subject: [libertybasic] Reading file with carriage returns

      I'm reading a large file with lots of carriage returns using the following
      basic code:

      open fileName$ for input as #1
      LINE INPUT #1, txt$

      As it's suppose to, it stops reading at every CR. How can I get it to
      ignore CR and just keep on trucking through the file until it reaches the
      end? I'm searching the file for certain characters.

      Or is the some way to strip out a CR when I bump into it?



      ------------------------------------

      Yahoo! Groups Links
    • daveclow1
      Thanks. Works like a champ. Too simple.
      Message 2 of 3 , Jul 26, 2013
        Thanks. Works like a champ. Too simple.

        --- In libertybasic@yahoogroups.com, "Jim Hiley" <jim@...> wrote:
        >
        > This code reads the complete file into a string:
        >
        > open fileName$ for input as #1
        > txt$=input$(#1,lof(#1))
        > close #1
        >
        > Jim
        >
        >
        > -----Original Message-----
        > From: libertybasic@yahoogroups.com [mailto:libertybasic@yahoogroups.com] On
        > Behalf Of daveclow1
        > Sent: Friday, 26 July 2013 06:53
        > To: libertybasic@yahoogroups.com
        > Subject: [libertybasic] Reading file with carriage returns
        >
        > I'm reading a large file with lots of carriage returns using the following
        > basic code:
        >
        > open fileName$ for input as #1
        > LINE INPUT #1, txt$
        >
        > As it's suppose to, it stops reading at every CR. How can I get it to
        > ignore CR and just keep on trucking through the file until it reaches the
        > end? I'm searching the file for certain characters.
        >
        > Or is the some way to strip out a CR when I bump into it?
        >
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.