home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / system / eolcon.lha / EOLCon.doc < prev    next >
Encoding:
Text File  |  1992-05-26  |  5.6 KB  |  156 lines

  1.  
  2.   EOLCon v1.3
  3.  
  4.     Usage : EOLCon <infile> <outfile> <0|1|2|x> [buffersize]
  5.  
  6.        infile should be an ascii text file
  7.  
  8.        outfile can either be a filename for
  9.       the output, OR it can be an asterisk
  10.       (*) to denote that you wish to use
  11.       the same name as <infile>.  Using the
  12.       asterisk for <outfile> will cause a
  13.       temporary file to be created as output,
  14.       then renamed to <infile> after completion.
  15.       Use the force, read the source!
  16.  
  17.        0 will remove all character 13's
  18.       (carriage returns) in the file.
  19.  
  20.        1 will add character 13's to the
  21.       end of every line.  Any additional
  22.       CR's found in the middle of a line
  23.       will be deleted.  Only one char 13
  24.       will ever be left on one line, and
  25.       it will always be right before the
  26.       linefeed.  Guaranteed.  :-)
  27.  
  28.        2 will replace any carriage returns by
  29.       a linefeed.  This is used with files
  30.       that contain no linefeeds of their
  31.       own to begin with.
  32.  
  33.        x represents any printable character.  It
  34.       will placed at the end of every line.
  35.       This can be any printable key on the
  36.       keyboard except '0', '1', and '2' (for
  37.       obvious reasons).
  38.  
  39.        buffersize is the number of bytes to use
  40.       for I/O ; be aware that the actual
  41.       amount of memory used is double this
  42.       if removing or replacing CR's ("0" or
  43.       "2" from above description) and triple
  44.       otherwise ("1" or "x" above).
  45.       The default is 10000, which means up to
  46.       30000 bytes of memory may be allocated.
  47.       Why so much?    I could've used dynamically
  48.       allocated space and saved memory, but
  49.       my primary goal for this program was
  50.       SPEED.  I'd rather just grab a big hunk
  51.       and be on my way than constantly getting
  52.       free nodes throughout the ConvertFile()
  53.       loop.  Plus, the source is included.    Fix
  54.       it if it offends you.  :-)  Incidentally,
  55.       the sizes aren't arbitrary...they're worst-
  56.       case approximations.    The worst case is if
  57.       every line of input contains only the line-
  58.       feed char.  This means, for x number of
  59.       input chars, there will be x number of CR's
  60.       (or whatever character you desire) added
  61.       on.  I keep the input and output buffers
  62.       separate, so that is 3x amount of bytes.
  63.       x for the input buffer, 2x for the output
  64.       buffer.  It's better for the "remove CR"
  65.       command ("0")...in this case the buffer is
  66.       2x ; x for the input, x for the output.
  67.  
  68.  
  69.  
  70.  
  71.  
  72.    This program will make the end-of-line character
  73. anything the user wants (well, except for the '0', '1',
  74. and '2' characters...they have separate meaning...see
  75. 'Usage' above).  When I say 'end-of-line', I actually
  76. mean the character right BEFORE the linefeed char.
  77. The more obvious and most common use of this program
  78. is for porting ascii files back and forth between the
  79. Amiga and MS-DOS machines...the latter uses a carriage
  80. return before each linefeed to designate the end of
  81. a line, and the Amiga does not (just a linefeed).
  82.  
  83.    The reason I bothered writing another one of these
  84. end-of-line converters is that none I had used combined
  85. speed with accuracy ; that is, they either
  86. were slow, or they had a few problems in actually doing
  87. the converting : some would add on another carriage
  88. return even if the file already contained them.  Granted,
  89. you may want to do such a thing, but it is highly
  90. unlikely in my opinion.  This program will NOT let a
  91. file slip through its fingers with more than one CR per
  92. line.  Since the source is provided, you can change this
  93. if you want.
  94.  
  95.    In an effort to make this the EOL converter to end
  96. them all, I made speed my first goal.  Since you can make
  97. the buffer as big as you have fast ram, you can get very
  98. fast -- on my hard drive, I converted a 200 Kbyte ascii
  99. file (with the '1' command to add carriage returns) in
  100. about 3 seconds using a buffersize of 200000.  My second
  101. goal was to add some options that I thought were quite
  102. useful in such a program -- a user-definable buffer and
  103. the ability to make the end-of-line (well, at least the
  104. last one before the linefeed) character user-definable.
  105. The latter I added for the use of UUENCODED (or
  106. XXENCODED, as the case may be!!!) files, so
  107. up/downloading on other machines doesn't corrupt the
  108. data (I'm referring to spaces at the end of lines).  I
  109. also found it was real easy and may come in handy in
  110. the far future.  :~)
  111.  
  112.    NOTE : Removing carriage returns with the "0"
  113. command will remove ALL carriage return characters in
  114. the file!  I did this because some *OTHER* converters
  115. I've tried in the past interspersed them throughout the
  116. file (not just at the end of each line).  If any of
  117. you have used such a 'program', running EOLCon on the
  118. damaged file will repair it, at least to the point of
  119. getting rid of every one of the carriage returns.
  120.  
  121.  
  122.  
  123.    IMPORTANT :
  124.       -------------------------------------------
  125.       I'm releasing this into the Public Domain.
  126.       This is free.  Do whatever you like with
  127.       this program...if you're humble enough to
  128.       give me credit for this, all the better
  129.       (but I don't require it).
  130.  
  131.       Hack the code if you want.  Give yourself
  132.       full credit.  I don't care.  You can use
  133.       any or all of the source code at your
  134.       discretion.  I wrote this for my own use
  135.       and later decided someone else might want
  136.       it too.  Granted, it's a pretty ridiculous
  137.       little program, but if it works, use it!
  138.       -------------------------------------------
  139.  
  140.       I would appreciate hearing any comments and
  141.       especially BUG-REPORTS, so E-Mail (this sort of
  142.       program doesn't warrant a Snail address...) me :
  143.  
  144.       CRVICH @ CSUGRAD.CS.VT.EDU
  145.       GENERAL @ VTVM1.CC.VT.EDU
  146.       GENERAL @ VTVM1.BITNET
  147.  
  148.  
  149.       Ernest Crvich
  150.       Virginia Polytechnic Institute
  151.       and State University
  152.       Blacksburg, VA
  153.  
  154.  
  155.    Greets to that Belgian lunatic...Pres!!!
  156.