<html><head>
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta name="Generator" content="Novell Groupwise Client (Version 14.0.0 Build: 115243)">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head><body style="font: 10pt/normal Segoe UI; margin: 16px 16px 4px; font-size-adjust: none; font-stretch: normal;"><div id="GroupWiseSection_1444224077000_klarson@k12group.net_59511A0513870000BD1BF681F57056B0_" class="GroupWiseMessageBody"><div>I like that even better. Thank you.</div><span style="margin-bottom: 5px; display: block;"> </span><div id="GroupWiseSection_1444221369000_spp@unixsa.net" class="GroupWiseMessageBody"><span class="GroupwiseReplyHeader">>>> Stephen Potter <spp@unixsa.net> 10/7/2015 8:36 AM >>><br></span><div><span style="background-color: rgb(255, 255, 255);" text="#000000" bgcolor="#FFFFFF">>
Assuming the header has "Gender" for the column title,<div> </div>
<div> </div>
egrep 'Gender|,M,' source.csv > males.csv<div> </div>
egrep 'Gender|,F,' source.csv > females.csv<div> </div>
<div> </div>
Change the title and the criteria for the gender to match your file
(like ",M$" if at the end, etc). To make it case insensitive, use
"egrep -i".<div> </div>
<div> </div>
Going back to earlier conversation about shell tests, this could
also depend on what you are running it on. The grep on linux allows<div> </div>
<div> </div>
grep -E instead of egrep. It also has grep -P to allow PCRE.<div> </div>
<div> </div>
-spp<div> </div>
<div> </div>
<div class="moz-cite-prefix">On 10/6/2015 8:35 PM, Rick Hornsby
wrote:<br>
</div>
<blockquote cite="mid:78A84BF7-3109-480D-821B-496CD1E1D279@gmail.com" type="cite">
<br>
<div>
<blockquote type="cite">
<div>On Oct 6, 2015, at 18:57, Keith Larson <<a href="mailto:klarson@k12group.net" moz-do-not-send="true"><a class="moz-txt-link-abbreviated" href="mailto:klarson@k12group.net">klarson@k12group.net</a>> wrote:</div>
<div>
<div style="font: 10pt/normal Segoe UI; font-size-adjust: none; font-stretch: normal;">
<div id="GroupWiseSection_1444175483000_klarson@k12group.net_59511A0513870000BD1BF681F57056B0_" class="GroupWiseMessageBody">
<div><br>
</div>
</div>
</div>
</div>
</blockquote>
<blockquote type="cite">
<div>
<div style="font: 10pt/normal Segoe UI; font-size-adjust: none; font-stretch: normal;">
<div id="GroupWiseSection_1444175483000_klarson@k12group.net_59511A0513870000BD1BF681F57056B0_" class="GroupWiseMessageBody">
<div>I would like the header row in both files
if possible. </div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>To copy the header line, start thusly:</div>
<div>head -1 source.csv > males.csv</div>
<div>head -1 source.csv > females.csv</div>
<div><br>
</div>
<div>and every operation following that writes to the files, use
the >> append operator.</div>
<div><br>
</div>
</div>
<div> </div>
<fieldset class="mimeAttachmentHeader"></fieldset>
<div> </div>
<pre wrap="">_______________________________________________
colug-432 mailing list
<a class="moz-txt-link-abbreviated" href="mailto:colug-432@colug.net">colug-432@colug.net</a>
<a class="moz-txt-link-freetext" href="http://lists.colug.net/mailman/listinfo/colug-432">http://lists.colug.net/mailman/listinfo/colug-432</a>
</pre>
</blockquote>
<div> </div>
</span></div></div></div></body></html>