home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 620.lha / EOLCon_v1.2 / EOLCon.doc.pp / EOLCon.doc
Encoding:
Text File  |  1992-03-02  |  5.9 KB  |  163 lines

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