Re: Need to know if a file as only ASCII charaters

2009-06-17 Thread Wolfgang Rohdewald
On Wednesday 17 June 2009, Lie Ryan wrote: > Wolfgang Rohdewald wrote: > > On Wednesday, 17. June 2009, Steven D'Aprano wrote: > >> while text: > >> for c in text: > >> if c not in printable: return False > > > > that is one loop per character. > > unless print

Re: Need to know if a file as only ASCII charaters

2009-06-16 Thread Lie Ryan
Wolfgang Rohdewald wrote: > On Wednesday, 17. June 2009, Steven D'Aprano wrote: >> while text: >> for c in text: >> if c not in printable: return False > > that is one loop per character. unless printable is a set > wouldn't it be faster to apply a regex to te

Re: Need to know if a file as only ASCII charaters

2009-06-16 Thread Lie Ryan
Scott David Daniels wrote: > norseman wrote: >> Scott David Daniels wrote: >>> Dave Angel wrote: Jorge wrote: ... > I'm making a application that reads 3 party generated ASCII files, > but some times the files are corrupted totally or partiality and I > need to know if it's a ASCI

Re: Need to know if a file as only ASCII charaters

2009-06-16 Thread Wolfgang Rohdewald
On Wednesday, 17. June 2009, Steven D'Aprano wrote: > while text: > for c in text: > if c not in printable: return False that is one loop per character. wouldn't it be faster to apply a regex to text? something like while text: if re.search(r'\W',text)

Re: Need to know if a file as only ASCII charaters

2009-06-16 Thread Steven D'Aprano
On Tue, 16 Jun 2009 10:42:58 -0700, Scott David Daniels wrote: > Dave Angel wrote: >> Jorge wrote: >>> Hi there, >>> I'm making a application that reads 3 party generated ASCII files, >>> but some >>> times >>> the files are corrupted totally or partiality and I need to know if >>> it's a >>> ASC

Re: Need to know if a file as only ASCII charaters

2009-06-16 Thread norseman
Scott David Daniels wrote: norseman wrote: Scott David Daniels wrote: Dave Angel wrote: Jorge wrote: ... I'm making a application that reads 3 party generated ASCII files, but some times the files are corrupted totally or partiality and I need to know if it's a ASCII file with *nix line ter

Re: Need to know if a file as only ASCII charaters

2009-06-16 Thread Scott David Daniels
norseman wrote: Scott David Daniels wrote: Dave Angel wrote: Jorge wrote: ... I'm making a application that reads 3 party generated ASCII files, but some times the files are corrupted totally or partiality and I need to know if it's a ASCII file with *nix line terminators. In linux I can ru

Re: Need to know if a file as only ASCII charaters

2009-06-16 Thread MRAB
norseman wrote: Scott David Daniels wrote: Dave Angel wrote: Jorge wrote: Hi there, I'm making a application that reads 3 party generated ASCII files, but some times the files are corrupted totally or partiality and I need to know if it's a ASCII file with *nix line terminators. In linux

Re: Need to know if a file as only ASCII charaters

2009-06-16 Thread norseman
Scott David Daniels wrote: Dave Angel wrote: Jorge wrote: Hi there, I'm making a application that reads 3 party generated ASCII files, but some times the files are corrupted totally or partiality and I need to know if it's a ASCII file with *nix line terminators. In linux I can run the fil

Re: Need to know if a file as only ASCII charaters

2009-06-16 Thread Scott David Daniels
Dave Angel wrote: Jorge wrote: Hi there, I'm making a application that reads 3 party generated ASCII files, but some times the files are corrupted totally or partiality and I need to know if it's a ASCII file with *nix line terminators. In linux I can run the file command but the applicatio

Re: Need to know if a file as only ASCII charaters

2009-06-16 Thread pdpi
On Jun 16, 2:17 pm, Dave Angel wrote: > Jorge wrote: > > Hi there, > > I'm making  a application that reads 3 party generated ASCII files, but some > > times > > the files are corrupted totally or partiality and I need to know if it's a > > ASCII file with *nix line terminators. > > In linux I can

Re: Need to know if a file as only ASCII charaters

2009-06-16 Thread Dave Angel
Jorge wrote: Hi there, I'm making a application that reads 3 party generated ASCII files, but some times the files are corrupted totally or partiality and I need to know if it's a ASCII file with *nix line terminators. In linux I can run the file command but the applications should run in window

Need to know if a file as only ASCII charaters

2009-06-16 Thread Jorge
Hi there, I'm making a application that reads 3 party generated ASCII files, but some times the files are corrupted totally or partiality and I need to know if it's a ASCII file with *nix line terminators. In linux I can run the file command but the applications should run in windows. Any help wi