
Does the regex support an OR? I.e. files starting with 2010 or 2011 (because the period spans across 2 different years) I think I will run the regex for 2010 and then append the created file with the IDs for 2011. Thanx guys On Thu, Jun 13, 2013 at 2:00 PM, Simon Mburu <sgatonye@gmail.com> wrote:
A simple cat and grep, should do it. Something in the lines of
cat file1 | egrep ^2008\(06\|07\|08\|09) > file2
On Thu, Jun 13, 2013 at 1:12 PM, Anthony Lenya <tlensya@gmail.com> wrote:
my take is that bash tools along with AWK will be much better placed to do the job. You can sort and redirect the output to a file thus ensuring that the primary source remains intact.
On Thu, Jun 13, 2013 at 1:04 PM, Tony Likhanga <tlikhanga@gmail.com>wrote:
On a linux box, grep -A piped into grep -B with the output redirected into a new file always sorts me out. (Probably egrep works the same on other platforms)
The trick is : 1. Identify the exact start of the records you want to filter out 2. Identify the exact end of the records you want to filter out 3. Make an intelligent estimation of the number of lines contained in between the start & end entries.
Otherwise, sed may have some pretty neat solution if you dig deeper.
_______________________________________________ skunkworks mailing list skunkworks@lists.my.co.ke ------------ List info, subscribe/unsubscribe http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------
Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
_______________________________________________ skunkworks mailing list skunkworks@lists.my.co.ke ------------ List info, subscribe/unsubscribe http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------
Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
_______________________________________________ skunkworks mailing list skunkworks@lists.my.co.ke ------------ List info, subscribe/unsubscribe http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------
Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke