www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/01/06/15:35:00

Date: Fri, 6 Jan 1995 11:33:55 -0800 (PST)
From: Darwin Hawes <hawes AT physics DOT ubc DOT ca>
Subject: Re: reading '\t' in files
To: Jon Keene <jkeene AT unlinfo DOT unl DOT edu>
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu

On Thu, 5 Jan 1995, Jon Keene wrote:

> Hello,
>    I'm new to DJGPP, but pretty impressed.  I have a question:
> I've written a program that reads from stdin, counts blanks, tabs and 
> newlines, and outputs those numbers.  When I run it on input from the
> keyboard it works correctly, but when I redirect input from a file the
> number of tabs always comes out zero.  Is this some peculiarity of
> DJGPP? Or DOS text files?

Many dos editors replace tabs with an appropriate number of spaces.  Try
creating a file by typing 
  
  copy con file

Then typing in your test file.  Press ^Z to exit.  run that file through
your program, and it should output the correct number of tabs.

##########=========================-------------------------------------*
# Darwin Hawes  <hawes AT physics DOT ubc DOT ca>                                  |
I This is a typical net.posting.  Any resemblance to reality is         I 
| strictly coincidental.                                                #
*-------------------------------------=========================########## 




- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019