You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

concat.html 3.9 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>Concat</title>
  5. </head>
  6. <body>
  7. <h2><a name="Concat">Concat</a></h2>
  8. <h3>Description</h3>
  9. <p>
  10. Concatenates a file, or a series of files, to a single file or
  11. the console. The destination file will be created if it does
  12. not exist, though the the <var>append</var> attribute may be
  13. used to alter this behavior.
  14. </p>
  15. <p>
  16. <a href="../CoreTypes/fileset.html">FileSet</a>s and/or <a
  17. href="../CoreTypes/filelist.html">FileList</a>s are used to
  18. select which files are to be concatenated. There is no
  19. singular 'file' attribute to specify a single file to cat -- a
  20. fileset or filelist must also be used in these cases.
  21. </p>
  22. <h3>Parameters</h3>
  23. <table border="1" cellpadding="2" cellspacing="0">
  24. <tr>
  25. <td valign="top"><b>Attribute</b></td>
  26. <td valign="top"><b>Description</b></td>
  27. <td align="center" valign="top"><b>Required</b></td>
  28. </tr>
  29. <tr>
  30. <td valign="top">destfile</td>
  31. <td valign="top">
  32. The destination file for the concatenated stream.
  33. If not specified the console will be used instead.
  34. </td>
  35. <td valign="top" align="center">
  36. No
  37. </td>
  38. </tr>
  39. <tr>
  40. <td valign="top">append</td>
  41. <td valign="top">
  42. Specifies whether or not the file specified by 'destfile'
  43. should be overwritten. Defaults to &quot;yes&quot;.
  44. </td>
  45. <td valign="top" align="center">No</td>
  46. </tr>
  47. <tr>
  48. <td valign="top">encoding</td>
  49. <td valign="top">
  50. Specifies the encoding for the input files. Please see <a
  51. href="http://java.sun.com/products/jdk/1.2/docs/guide/internat/encoding.doc.html">
  52. http://java.sun.com/products/jdk/1.2/docs/guide/internat/encoding.doc.html</a>
  53. for a list of possible values. Defaults to the platform's
  54. default character encoding.
  55. </td>
  56. <td valign="top" align="center">No</td>
  57. </tr>
  58. </table>
  59. <h3>Parameters specified as nested elements</h3>
  60. <h4>fileset</h4>
  61. <p>
  62. <a href="../CoreTypes/fileset.html">FileSet</a>s are used to
  63. select files to be concatenated. Note that the order in which
  64. the files selected from a fileset are concatenated is
  65. <i>not</i> guaranteed. If this is an issue, use multiple
  66. filesets or consider using filelists.
  67. </p>
  68. <h4>filelist</h4>
  69. <p>
  70. <a href="../CoreTypes/filelist.html">FileList</a>s are used to
  71. select files to be concatenated. The file ordering in the
  72. <var>files</var> attribute will be the same order in which the
  73. files are concatenated.
  74. </p>
  75. <h3>Examples</h3>
  76. <p><b>Concatenate a string to a file:</b></p>
  77. <pre>
  78. &lt;concat destfile=&quot;README&quot;&gt;Hello, World!&lt;/concat&gt;
  79. </pre>
  80. <p><b>Concatenate a series of files to the console:</b></p>
  81. <pre>
  82. &lt;concat&gt;
  83. &lt;fileset dir=&quot;messages&quot; includes=&quot;*important*&quot; /&gt;
  84. &lt;/concat&gt;
  85. </pre>
  86. <p><b>Concatenate a single file, appending if the destination file exists:</b></p>
  87. <pre>
  88. &lt;concat destfile=&quot;NOTES&quot; append=&quot;true&quot;&gt;
  89. &lt;filelist dir=&quot;notes&quot; files=&quot;note.txt&quot; /&gt;
  90. &lt;/concat&gt;
  91. </pre>
  92. <p><b>Concatenate a series of files, overwriting if the
  93. destination file exists:</b></p>
  94. <pre>
  95. &lt;concat destfile=&quot;${docbook.dir}/all-sections.xml&quot;&gt;
  96. &lt;filelist dir=&quot;${docbook.dir}/sections&quot;
  97. files=&quot;introduction.xml,overview.xml&quot; /&gt;
  98. &lt;fileset dir=&quot;${docbook.dir}&quot;
  99. includes=&quot;sections/*.xml&quot;
  100. excludes=&quot;introduction.xml,overview.xml&quot; /&gt;
  101. &lt;/concat&gt;
  102. </pre>
  103. <hr>
  104. <p align="center">
  105. Copyright &copy; 2002 Apache Software Foundation. All
  106. Rights Reserved.
  107. </p>
  108. </body>
  109. </html>