????grep

????grep?? egrep?? fgrep – ????????????????????

???????????????Patterns of Enterprise Architecture??????????????????grep????????????????????Patterns??????????

    jfields$ cat order.* | sort | grep Patterns 
    8:22:19 111?? 1?? Patterns of Enterprise Architecture?? Kindle edition?? 39.99 
    8:24:19 113?? -1?? Patterns of Enterprise Architecture?? Kindle edition??

?????????????113?????Щ?????????????????????——??????????grep???

    jfields$ cat order.* | sort | grep ":dd 113?? " 
    8:24:19 113?? -1?? Patterns of Enterprise Architecture?? Kindle edition?? 39.99 
    8:24:20 113?? Refund sent to processing

???????????grep????????????“113”?????Щ??????????????????113??????????????????????????????????????????????????????????????

???????????????????????????????????????????????????????????????????Patterns of Enterprise Architecture???????????????????????????????????????????г????????????κ??????

????cut

????cut – ?????????????????Щ????

??????????grep????????grep???????????????С??????????????????????????????????г?С?Σ???????????????????

    jfields$ cat order.* | sort | grep Patterns 
    8:22:19 111?? 1?? Patterns of Enterprise Architecture?? Kindle edition?? 39.99 
    8:24:19 113?? -1?? Patterns of Enterprise Architecture?? Kindle edition?? 39.99 
    
    jfields$ cat order.* | sort | grep Patterns | cut -d"??" -f2??5 
     1?? 39.99 
     -1?? 39.99

????????????????????????????????????????????Щ?????????Excel????????????????

????cut???????????????????????????????????????????????и????????????????????????????????ID?????????????????????????????????????cut??????ID????????????????ID????е?????????????

????sed

????sed – ???????????????????????????????л?????????任??

??????????????????????sed????任?????????У??????????????cut?????????????

    jfields$ cat order.* | sort | grep Patterns  
    >| sed s/"[0-9:]* ([0-9]*)?? (.*)"/"2?? '1'"/ 
    1?? Patterns of Enterprise Architecture?? Kindle edition?? 39.99?? '111' 
    -1?? Patterns of Enterprise Architecture?? Kindle edition?? 39.99?? '113' 
    
    lmp-jfields01:~ jfields$ cat order.* | sort | grep Patterns  
    >| sed s/"[0-9:]* ([0-9]*)?? (.*)"/"2?? '1'"/ | cut -d"??" -f1??4??5 
    1?? 39.99?? '111' 
    -1?? 39.99?? '113'

???????????????????????????????????????????????????????????????漸??????

?????? ???????

?????? ?????????

?????? ?????????????????

?????? ??????μ??????

???????????????б???е??????????????????????????Щ??

?????????????????????????????????????? 1 & 2 ???洢?????????????????????????????????????????м??????????????????????????????????????????????cut????????????????????

???????????????鷳???????????????????????log?????????????????????????????????????????????????????Щ?顣