Mercurial > repos > deepakjadmin > mayatool3_test2
view docs/scripts/html/SortTextFiles.html @ 0:4816e4a8ae95 draft default tip
Uploaded
author | deepakjadmin |
---|---|
date | Wed, 20 Jan 2016 09:23:18 -0500 |
parents | |
children |
line wrap: on
line source
<html> <head> <title>MayaChemTools:Documentation:SortTextFiles.pl</title> <meta http-equiv="content-type" content="text/html;charset=utf-8"> <link rel="stylesheet" type="text/css" href="../../css/MayaChemTools.css"> </head> <body leftmargin="20" rightmargin="20" topmargin="10" bottommargin="10"> <br/> <center> <a href="http://www.mayachemtools.org" title="MayaChemTools Home"><img src="../../images/MayaChemToolsLogo.gif" border="0" alt="MayaChemTools"></a> </center> <br/> <div class="DocNav"> <table width="100%" border=0 cellpadding=0 cellspacing=2> <tr align="left" valign="top"><td width="33%" align="left"><a href="./SortSDFiles.html" title="SortSDFiles.html">Previous</a> <a href="./index.html" title="Table of Contents">TOC</a> <a href="./SplitSDFiles.html" title="SplitSDFiles.html">Next</a></td><td width="34%" align="middle"><strong>SortTextFiles.pl</strong></td><td width="33%" align="right"><a href="././code/SortTextFiles.html" title="View source code">Code</a> | <a href="./../pdf/SortTextFiles.pdf" title="PDF US Letter Size">PDF</a> | <a href="./../pdfgreen/SortTextFiles.pdf" title="PDF US Letter Size with narrow margins: www.changethemargins.com">PDFGreen</a> | <a href="./../pdfa4/SortTextFiles.pdf" title="PDF A4 Size">PDFA4</a> | <a href="./../pdfa4green/SortTextFiles.pdf" title="PDF A4 Size with narrow margins: www.changethemargins.com">PDFA4Green</a></td></tr> </table> </div> <p> </p> <h2>NAME</h2> <p>SortTextFiles.pl - Sort TextFile(s) using values for a column</p> <p> </p> <h2>SYNOPSIS</h2> <p>SortTextFiles.pl TextFile(s)...</p> <p>SortTextFiles.pl [<strong>-d, --detail</strong> infolevel] [<strong>-h, --help</strong>] [<strong>--indelim</strong> comma | semicolon] [<strong>-k, --key</strong> colnum | collabel] [<strong>--keydata</strong> numeric | alphanumeric] [<strong>-m, --mode</strong> colnum | collabel] [<strong>-o, --overwrite</strong>] [<strong>--outdelim</strong> comma | tab | semicolon] [<strong>-q, --quote</strong> yes | no] [<strong>-r, --root</strong> rootname] [<strong>-s, --sort</strong> ascending | descending] [<strong>-w, --workingdir</strong> dirname] TextFile(s)...</p> <p> </p> <h2>DESCRIPTION</h2> <p>Sort <em>TextFile(s)</em> using values for a key column specified by a column number or label. Only one column key can be specified for sorting. In an event of conflict during sorting process, two similar values for a column key are simply transferred to output files in order of their presence in input files. Additionally, rows with empty or inappropriate values for column key are simply placed at the end. The file names are separated by space. The valid file extensions are <em>.csv</em> and <em>.tsv</em> for comma/semicolon and tab delimited text files respectively. All other file names are ignored. All the text files in a current directory can be specified by <em>*.csv</em>, <em>*.tsv</em>, or the current directory name. The <strong>--indelim</strong> option determines the format of <em>TextFile(s)</em>. Any file which doesn't correspond to the format indicated by <strong>--indelim</strong> option is ignored.</p> <p> </p> <h2>OPTIONS</h2> <dl> <dt><strong><strong>-d, --detail</strong> <em>infolevel</em></strong></dt> <dd> <p>Level of information to print about lines being ignored. Default: <em>1</em>. Possible values: <em>1, 2 or 3</em>.</p> </dd> <dt><strong><strong>-h, --help</strong></strong></dt> <dd> <p>Print this help message.</p> </dd> <dt><strong><strong>--indelim</strong> <em>comma | semicolon</em></strong></dt> <dd> <p>Input delimiter for CSV <em>TextFile(s)</em>. Possible values: <em>comma or semicolon</em>. Default value: <em>comma</em>. For TSV files, this option is ignored and <em>tab</em> is used as a delimiter.</p> </dd> <dt><strong><strong>-k, --key</strong> <em>col number | col name</em></strong></dt> <dd> <p>This value is mode specific. It specifies which column to use for sorting <em>TextFile(s)</em>. Possible values: <em>col number or col label</em>. Default value: <em>first column</em>.</p> </dd> <dt><strong><strong>--keydata</strong> <em>numeric | alphanumeric</em></strong></dt> <dd> <p>Data type for column key. Possible values: <em>numeric or alphanumeric</em>. Default value: <em>numeric</em>. For <em>alphanumeric</em> data values, comparison is case insensitive.</p> </dd> <dt><strong><strong>-m, --mode</strong> <em>colnum | collabel</em></strong></dt> <dd> <p>Specify how to sort text files: using column number or column label. Possible values: <em>colnum or collabel</em>. Default value: <em>colnum</em>.</p> </dd> <dt><strong><strong>-o, --overwrite</strong></strong></dt> <dd> <p>Overwrite existing files.</p> </dd> <dt><strong><strong>--outdelim</strong> <em>comma | tab | semicolon</em></strong></dt> <dd> <p>Output text file delimiter. Possible values: <em>comma, tab, or semicolon</em> Default value: <em>comma</em>.</p> </dd> <dt><strong><strong>-q, --quote</strong> <em>yes | no</em></strong></dt> <dd> <p>Put quotes around column values in output text file. Possible values: <em>yes or no</em>. Default value: <em>yes</em>.</p> </dd> <dt><strong><strong>-r, --root</strong> <em>rootname</em></strong></dt> <dd> <p>New text file name is generated using the root: <Root>.<Ext>. Default new file name: <InitialTextFileName>SortedByColumn.<Ext>. The csv, and tsv <Ext> values are used for comma/semicolon, and tab delimited text files respectively. This option is ignored for multiple input files.</p> </dd> <dt><strong><strong>-s, --sort</strong> <em>ascending | descending</em></strong></dt> <dd> <p>Sorting order for column values. Possible values: <em>ascending or descending</em>. Default value: <em>ascending</em>.</p> </dd> <dt><strong><strong>-w, --workingdir</strong> <em>dirname</em></strong></dt> <dd> <p>Location of working directory. Default: current directory.</p> </dd> </dl> <p> </p> <h2>EXAMPLES</h2> <p>To perform numerical sort in ascending order using first column values and generate a new CSV text file NewSample1.csv, type:</p> <div class="ExampleBox"> % SortTextFiles.pl -o -r NewSample1 Sample1.csv</div> <p>To perform numerical sort in descending order using MolWeight column and generate a new CSV text file NewSample1.csv, type:</p> <div class="ExampleBox"> % SortTextFiles.pl -m collabel -k MolWeight --keydata numeric -s descending -r NewSample1 -o Sample1.csv</div> <p>To perform numerical sort in ascending order using column number 1 and generate a new TSV text file NewSample1.csv, type:</p> <div class="ExampleBox"> % SortTextFiles.pl -m colnum -k 1 --keydata numeric -s ascending -r NewSample1 --outdelim tab -o Sample1.csv</div> <p> </p> <h2>AUTHOR</h2> <p><a href="mailto:msud@san.rr.com">Manish Sud</a></p> <p> </p> <h2>SEE ALSO</h2> <p><a href="./JoinTextFiles.html">JoinTextFiles.pl</a>, <a href="./MergeTextFilesWithSD.html">MergeTextFilesWithSD.pl</a>, <a href="./ModifyTextFilesFormat.html">ModifyTextFilesFormat.pl</a>, <a href="./SplitTextFiles.html">SplitTextFiles.pl</a>, <a href="./TextFilesToHTML.html">TextFilesToHTML.pl</a> </p> <p> </p> <h2>COPYRIGHT</h2> <p>Copyright (C) 2015 Manish Sud. All rights reserved.</p> <p>This file is part of MayaChemTools.</p> <p>MayaChemTools is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.</p> <p> </p><p> </p><div class="DocNav"> <table width="100%" border=0 cellpadding=0 cellspacing=2> <tr align="left" valign="top"><td width="33%" align="left"><a href="./SortSDFiles.html" title="SortSDFiles.html">Previous</a> <a href="./index.html" title="Table of Contents">TOC</a> <a href="./SplitSDFiles.html" title="SplitSDFiles.html">Next</a></td><td width="34%" align="middle"><strong>March 29, 2015</strong></td><td width="33%" align="right"><strong>SortTextFiles.pl</strong></td></tr> </table> </div> <br /> <center> <img src="../../images/h2o2.png"> </center> </body> </html>