home *** CD-ROM | disk | FTP | other *** search
/ Internet Standards / CD1.mdf / dostools / crlf.doc next >
Text File  |  1994-01-30  |  8KB  |  265 lines

  1.  
  2.  
  3.                               CRLF
  4.                               ════
  5.  
  6.        (c) Copyright 1990,92 by Klaus Hartnegg, D-7835 Teningen
  7.  
  8.  
  9.  
  10. Description
  11. ───────────
  12. CRLF is a filter for text-files. It will ensure that each line of the 
  13. file ends correctly with CR (carriage return) and LF (line feed). It 
  14. will work regardless whether the input file contains CR's only, LF's 
  15. only or both intermixed or already is correct.
  16.  
  17.  
  18.  
  19. Background
  20. ──────────
  21. Most PC programs assume that all lines of a text files are terminated
  22. with the two special characters CR (carriage return) and LF (line feed).
  23.  
  24. However not all computers do it this way. On unix for example the
  25. Cr is usually missing. I even already hot files that contained CR and
  26. LF in the wrong order and some contained sequences like CR LF LF LF.
  27.  
  28. The program CRLF will correct all these cases: whenever it encounters
  29. either CR of LF it will assume that this is the end of a line and
  30. output CR and LF. When it encounters several CR and/or LF in sequence
  31. (even in strange orders, see above), it will try very hard to
  32. determine how many line breaks this shall be and output exactly this
  33. number of Cr + Lf. It will never output a CR or a LF alone.
  34.  
  35.  
  36. There is also a program included in this package that will do the
  37. reverse thing: StrpCrLf will wipe out Line Feed or Carriage Return
  38. characters.
  39.  
  40.  
  41.  
  42. Usage
  43. ─────
  44.  
  45. Syntax :  CRLF [infile [outfile]]
  46.  
  47. Infile and outfile are the names of an input and output-file. When
  48. outfile is omitted, a temporary file will be used and be moved over
  49. infile after the conversion has ended successfully.
  50.  
  51. Infile and outfile may contain the wildcard characters "?" and "*".
  52.  
  53. Infile may be a directory instead a file. In this case all files within 
  54. this directory will be converted.
  55.  
  56. Outfile may be a directory too. In this case the name for the output
  57. file(s) will be derived from the input file(s).
  58.  
  59. When both infile and outfile are directories all files from the input 
  60. directory will be converted and the results be written to the output 
  61. directory.
  62.  
  63.  
  64. You can also use CrLf as a unix-like filter i.e. it can read data from
  65. the standard input and write the translated data to standard output.
  66. CrLf will assume that you want to use it as a filter when the standard
  67. input is redirected. Please read your DOS manual to learn more about
  68. pipes and how to redirect standard input and output.
  69.  
  70.  
  71.  
  72. Examples:
  73.  
  74. - convert the file "ANY.TXT"
  75.   CRLF ANY.TXT
  76.  
  77. - convert "UNIX.TXT" to "DOS.TXT"
  78.   CRLF UNIX.TXT DOS.TXT
  79.  
  80. - convert all files in the directory "D:\TEXTS"
  81.   CRLF D:\TEXTS
  82.  
  83. - the same again but leave files in D:\TEXTS\EBCDIC unchanged and
  84.   write the output to D:\TEXTS\NEW
  85.   CRLF D:\TEXTS D:\TEXTS\NEW
  86.  
  87.  
  88. an example of using CrLf as filter:
  89.  
  90. - show ANY.TXT on screen using MORE:
  91.   TYPE ANY.TXT | CRLF | MORE
  92.  
  93.  
  94.  
  95. Technical notes:
  96. ────────────────
  97. CrLf will conserve the file date.
  98. Of course this will not work if it is used as a filter and the output
  99. is directed to a file.
  100.  
  101. Execution speed is about 6 kByte per second on a 12 MHz AT but will
  102. decrease dramatically if there are less than 100 kByte RAM available.
  103.  
  104. Please note that the conversion that CrLf does is in some cases NOT
  105. reversible, neither is the conversion done with StripCrLf.
  106. Look what happens here:
  107.  
  108. abc Cr Lf Lf def ──CrLf──> abc Cr Lf Cr Lf def ──StripCrLf──> abc Cr Cr def
  109.  
  110.  
  111.  
  112.  
  113. Known Bugs:
  114. ───────────
  115. Please avoid translating a file to itself.
  116. The contents of that file will get lost.
  117.  
  118.  
  119.  
  120. Revision history
  121. ────────────────
  122. 1.0,  July 1990
  123. (first release)
  124.  
  125. 1.1,  September 1990
  126. - error corrected that caused error messages to be written to the output
  127.   file rather than to the screen when output was redirected
  128. - StripLF added to CrLf package for E2A users
  129. - end-of-line detection completely rewritten
  130. - registration now handled with key-files
  131.  
  132. 1.2, skipped
  133.  
  134. 1.3, November 1990
  135. - wildcards allowed on unregistered copies too
  136. - registration reminder
  137. - visual byte counter during translation
  138.  
  139. 1.4, 2-Jan-1991
  140. - bug caused 1.3 to work with very small blocks (1024 bytes), thus being slow
  141. - removed restriction that caused crlf to truncate lines longer than 255
  142.   characters
  143. - version 1.4 is 1.4 times faster than version 1.3
  144.  
  145. 1.41, 8-Feb-1991
  146. - included StripCR
  147. - directory detection changed to work with DR-DOS too
  148.  
  149. 1.42, 16-Feb-1991
  150. - the previous version didn't work on XT's
  151.  
  152. 1.5, 8-Aug-1991
  153. - speed increase by 12%
  154. - some minor error corrections
  155. - use unique filename for temporary file
  156. - added programs StripLf and StripCr
  157.  
  158. 1.5a, 10-Apr-1992
  159. - combined StripLf and StripCr in one executable StrpCrLf.
  160.   See separate doc file for example batch programs that do
  161.   the same as StripLf and StripCr did.
  162.  
  163.  
  164. Included files
  165. ──────────────
  166. CRLF     EXE  the executable
  167. CRLF     DOC  this documentation
  168.  
  169. STRPCRLF EXE  program to wipe out carriage return or line feed characters
  170. STRPCRLF DOC  documentation for StrpCrLf
  171.  
  172. ORDER   .FRM  order form
  173. HARTNEGG.LST  list of all my shareware programs
  174.  
  175.  
  176.  
  177. future plans:
  178. ─────────────
  179. - enhanced error detection
  180. - enhanced wildcard-handling
  181.   (allow things like "*DAT.TXT" and "F*1.DAT")
  182. - option to exclude some files from the conversion process
  183.  
  184. You can encourage me to spend much more time into the further
  185. development of this program by paying the registration fee!
  186.  
  187.  
  188.  
  189. Disclaimer
  190. ──────────
  191. It is a well known fact that it is impossible to proof that any given 
  192. (non trivial) program is error free. Of course this software has been 
  193. tested extensively but is is nevertheless not possible to guarantee that 
  194. it will work correctly in all possible situations.
  195.  
  196. This software is provided as-is, without warranty of any kind. The 
  197. author shall not be liable to the user for any direct, indirect or 
  198. consequential loss arising from the use of or inability to use this 
  199. software.
  200.  
  201.  
  202.  
  203. License
  204. ───────
  205. This is a shareware product and thus not free. It is fully protected by 
  206. international copyright laws.
  207.  
  208. Shareware is distributed through public access channels so that you can 
  209. evaluate it before deciding wether or not to buy it. If you decide to 
  210. use this software then you are both under legal and moral obligations to 
  211. register it (see separate file ORDER.FRM for a registration form; Visa
  212. and Master Card accepted!). If you decide not to use it you are under no 
  213. obligation, just don't use it any more.
  214.  
  215. All corporate, business, government or other entities have to register
  216. BEFORE using this software.
  217.  
  218. You are free to copy and distribute this software as long as all files
  219. belonging to it are distributed together and are not modified in any 
  220. way. If possible please distribute the original ZIP archive.
  221.  
  222. You must NOT give the key-file away (see below). This file is proof of 
  223. your registration and contains your name and serial number.
  224.  
  225.  
  226.  
  227. Registering
  228. ───────────
  229. Upon payment of the registration fee you will receive a diskette with 
  230. - current unregistered versions of ALL programs that I am
  231.   distributing as shareware
  232. - the key-file(s) for the program(s) that you registered
  233.   (if any of my programs finds its corresponding key-file it will not 
  234.   display the annoying shareware reminder any more)
  235.  
  236. FREE UPDATE to ALL future versions: the key-files will not only work for
  237. the present, but also for all future versions of the same program, i.e. 
  238. you have to register only once!
  239.  
  240.  
  241. The shareware system and the continued availability of quality shareware
  242. products depend on YOUR willingness to register and pay for the software
  243. that you use. It's the registration fees YOU pay which allows to support
  244. and continue to develop such products! Without this support I can not 
  245. continue spending so much time in improving this program.
  246.  
  247. Show your support for shareware by registering those programs you 
  248. actually use. Shareware is kept alive by YOUR support!
  249.  
  250.  
  251. ────────────────────────────
  252.  
  253.    Klaus Hartnegg
  254.    Kleist-str. 7
  255.    D-7835 Teningen
  256.    Germany
  257.  
  258.  
  259. This software is under development. Error reports and other comments are
  260. welcome. Please do not hesitate to use electronic mail for communication.
  261. (these addresses may be valid only until end of 1992)
  262.  
  263. Bitnet   : hartnegg@dfrruf1
  264. Internet : hartnegg@ibm.ruf.uni-freiburg.de
  265.