home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / atari / st / tech / 6307 < prev    next >
Encoding:
Internet Message Format  |  1992-12-16  |  2.2 KB

  1. Path: sparky!uunet!utcsri!geac!torag!zooid!tndb!jimomura
  2. From: jimomura@tndb.UUCP (Jim Omura)
  3. Newsgroups: comp.sys.atari.st.tech
  4. Subject: Re: *Help*  I need to make a non-standard text file standard.
  5. Distribution: world
  6. Message-ID: <jimomura.02jo@tndb.UUCP>
  7. References:  <H._cc6LL0jI1_@elfhaven.ersys.edmonton.ab.ca>
  8. Date: 13 Dec 92 08:25:20 EST
  9. Organization: Not an Organization
  10. Lines: 38
  11.  
  12. In article <H._cc6LL0jI1_@elfhaven.ersys.edmonton.ab.ca> mforget@elfhaven.ersys.edmonton.ab.ca (Michel Forget) writes:
  13.  
  14. ...
  15.  
  16. >I normally use Personal Pascal, but in this case that is what seems to be
  17. >causing the problem.  I need to read a non-standard text file (the lines
  18. >are seperated by 10 ($0A), which is an LF, rather than 13/10, which would
  19. >be a carriage/return LF.  The reason this is causing so many problems is that
  20. >Personal Pascal (ReadLn) expects a perfect, standard file.
  21. >
  22. >So, does anyone have C source code to read in each byte of a file, and
  23. >write the data to a different file (inserting a carriage return where it
  24. >should be in the new file).  I have Sozobon C 1.33i so I will be able to
  25. >compile programs people offer.  C is not my specialty though (which you
  26. >probably guessed since I have to ask for help on such a simple problem).
  27. >
  28. ...
  29.  
  30.      I think I posted my "texcon.c" sources to the Net a while back.
  31. That program (which is also around on BBSes to some extent) will
  32. add LF after CR, add CR before LF, strip LF, strip CR, convert
  33. tabs to spaces, convert spaces to tabs or strip "high bit", or
  34. some combinations of the above, depending on the switches you set.
  35. But if you only have 1 or 2 files to do, the faster way just to add
  36. CR before LF is to use MicroEMACS.  Just load the file into MicroEMACS,
  37. add a space (or any other character) at the top of the file and delete
  38. the space again, and re-save the file back to disk.  The only reason
  39. you have to do this odd sounding "add a space and then delete it again"
  40. is to set the "file modified" flag.  Normally MicroEMACS will *not*
  41. write an unmodified file to disk.  It will assume that saving an
  42. unchanged file is a waste of time.  When MicroEMACS writes the file
  43. back to disk it will automatically save it with the correct
  44. End of Line (EOL).
  45.  
  46. --
  47.  
  48. Jim Omura, (416) 652-3880
  49. 'jimomura@lsuc'
  50.