#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    1
    Rep Power
    0

    Dear Seniors...Reading File Problem


    Hi fellow programmers, i'm currently having problems with opening certain files using my program. It can't read the carriage return of some of the files which comes from other sources such as Unix. As a result, the display is simply one long straight line which had to be scrolled horizontally...

    Is it the problem of binary files? I tried to use Notepad to open the file and the same problem occurs exactly as my program but when i use WordPad, the file opens nicely....please advise
  2. #2
  3. /(bb|[^b]{2})/

    Join Date
    Nov 2001
    Location
    Somewhere in the great unknown
    Posts
    5,163
    Rep Power
    793
    It is a difference in styles of carriage returns.
    Each major type of OS has its own style
    MS = /r/n
    *nix = /n
    Apple = /r

    You have to adjust to the different types of files.
    Applications like Notepad will not understand the different return types where as wordpad does.

IMN logo majestic logo threadwatch logo seochat tools logo