http://wiki.ljackson.us/index.php?title=Tr_Command&action=history&feed=atom Tr Command - Revision history 2024-03-29T12:36:39Z Revision history for this page on the wiki MediaWiki 1.7.1 http://wiki.ljackson.us/index.php?title=Tr_Command&diff=3324&oldid=prev Ljackson at 10:41, 27 February 2014 2014-02-27T10:41:48Z <p></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 10:41, 27 February 2014</td> </tr> <tr><td colspan="2" align="left"><strong>Line 12:</strong></td> <td colspan="2" align="left"><strong>Line 12:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> tr '[:upper:]' '[:lower:]'</td><td> </td><td style="background: #eee; font-size: smaller;"> tr '[:upper:]' '[:lower:]'</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Convert Windows Line Break to Unix</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> tr -d &quot;\r&quot;</td></tr> </table> Ljackson http://wiki.ljackson.us/index.php?title=Tr_Command&diff=3110&oldid=prev Ljackson at 23:21, 21 December 2008 2008-12-21T23:21:01Z <p></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 23:21, 21 December 2008</td> </tr> <tr><td colspan="2" align="left"><strong>Line 8:</strong></td> <td colspan="2" align="left"><strong>Line 8:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> cat fontprds.txt | tr -s &quot;\r\n&quot; &quot;,&quot;</td><td> </td><td style="background: #eee; font-size: smaller;"> cat fontprds.txt | tr -s &quot;\r\n&quot; &quot;,&quot;</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Convert string from upper case to lower case:</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> tr '[:upper:]' '[:lower:]'</td></tr> </table> Ljackson http://wiki.ljackson.us/index.php?title=Tr_Command&diff=3109&oldid=prev Ljackson at 23:10, 21 December 2008 2008-12-21T23:10:53Z <p></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 23:10, 21 December 2008</td> </tr> <tr><td colspan="2" align="left"><strong>Line 4:</strong></td> <td colspan="2" align="left"><strong>Line 4:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> tr '\t' ',' &lt;input_file&gt; &lt;output_file&gt;</td><td> </td><td style="background: #eee; font-size: smaller;"> tr '\t' ',' &lt;input_file&gt; &lt;output_file&gt;</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Replace &quot;New Line Character&quot; (Return) with comma:</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> cat fontprds.txt | tr -s &quot;\r\n&quot; &quot;,&quot;</td></tr> </table> Ljackson http://wiki.ljackson.us/index.php?title=Tr_Command&diff=3108&oldid=prev Ljackson at 23:05, 21 December 2008 2008-12-21T23:05:25Z <p></p> <p><b>New page</b></p><div>== Examples ==<br /> <br /> Convert tab delimited data into comma delimited:<br /> <br /> tr '\t' ',' &lt;input_file&gt; &lt;output_file&gt;</div> Ljackson