Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.acorn.programmer > #2036

Re: Reading text files with cr / lf line terminators

Message-ID <120808225503@arcade.demon.co.uk> (permalink)
From jgh@arcade.demon.co.uk (Jonathan Graham Harston)
Newsgroups comp.sys.acorn.programmer
Subject Re: Reading text files with cr / lf line terminators
References <52bb693e1fdaves@orpheusmail.co.uk>
Date 2012-08-08 22:41 +0100

Show all headers | View raw


daves wrote:
> This is okay on RiscOS generated files, but when I read a PC/Dos created
> file where each line ends in crlf I end up getting two lines, one with
> data, one blank.
...
> What's the best way of trapping this instance, particularly as it's
> possible that there will sometimes be genuinely valid blank lines.
 
http://mdfs.net/blib/StringIO is the cannonical method.
 
Credit to Richard Russell for the original version.
 
-- 
J.G.Harston - jgh@mdfs.net - mdfs.net/jgh
Whitby Yards Gazetteer - http://mdfs.net/Docs/Books/YofWhitby/Gazetteer

Back to comp.sys.acorn.programmer | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Reading text files with cr / lf line terminators Dave Stratford <daves@orpheusmail.co.uk> - 2012-08-07 09:05 +0100
  Re: Reading text files with cr / lf line terminators Vince M Hudd <vinceh@softrock.co.uk> - 2012-08-07 12:11 +0100
    Re: Reading text files with cr / lf line terminators Vince M Hudd <vinceh@softrock.co.uk> - 2012-08-07 12:26 +0100
      Re: Reading text files with cr / lf line terminators Dave Stratford <daves@orpheusmail.co.uk> - 2012-08-07 14:52 +0100
  Re: Reading text files with cr / lf line terminators Ron <beeb@woosh.co.nz> - 2012-08-07 23:35 +1200
    Re: Reading text files with cr / lf line terminators Alan Adams <alan@adamshome.org.uk> - 2012-08-07 14:21 +0100
      Re: Reading text files with cr / lf line terminators Jeremy Nicoll - news posts <jn.nntp.scrap007@wingsandbeaks.org.uk> - 2012-08-07 15:09 +0100
      Re: Reading text files with cr / lf line terminators Ron <beeb@woosh.co.nz> - 2012-08-08 03:01 +1200
        Re: Reading text files with cr / lf line terminators Ron <beeb@woosh.co.nz> - 2012-08-08 04:13 +1200
  Re: Reading text files with cr / lf line terminators Jeremy Nicoll - news posts <jn.nntp.scrap007@wingsandbeaks.org.uk> - 2012-08-07 15:20 +0100
  Re: Reading text files with cr / lf line terminators jgh@arcade.demon.co.uk (Jonathan Graham Harston) - 2012-08-08 22:41 +0100

csiph-web