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