В файле query2 выбрать все строки, в которых в адресе есть улица ("ST.").
Решение:
"^.\{31\}.*\{0,17\}ST\."
Script started on Thu Sep 5 07:42:02 2002 bash2-2.05$ grep "^.\{31\}.*\{0,17\}ST\." ../metod/query2 203:REBOUND SPORTS :2 E. 14TH ST. :NEW-YORK :NY:10009:5555989:10000 205:POINT GUARD :20 THURSTON ST. :YONKERS :NY:10956:5554766:3000 211:AT BAT :234 BEACHEM ST. :BROOKLINE :MA:02146:5557385:8000 212:ALL SPORT :1000 38TH ST. :BROOKLYN :NY:11210:5551739:6000 213:GOOD SPORT :400 46TH ST. :SUNNYSIDE :NY:11104:5553771:5000 214:AL'S PRO SHOP :45 SPRUCE ST. :SPRING :TX:77388:5555172:8000 223:VELO SPORTS :23 WHITE ST. :MALDEN :MA:02148:5554983:5000 228:FITNESS FIRST :5000 85TH ST. :JACKSON-HEIGHTS:NY:11372:5558710:4000 bash2-2.05$ Script done on Thu Sep 5 07:42:18 2002 |
В файле query1 выбрать все строки, в которых зарплата составляет целое число тысяч.
Решение 1:
"^.\{59\}[0-9]\{1,\}000[^0-9]*"
Script started on Thu Sep 5 07:44:14 2002 bash2-2.05$ grep "^.\{59\}[0-9]\{1,\}000[^0-9]*" ../metod/query1 7569 CHRIS L ALBERTS MANAGER RESEARCH NEW-YORK 3000 7788 DONALD T SCOTT ANALYST RESEARCH DALLAS 3000 7799 MATTHEW G FISHER ANALYST RESEARCH NEW-YORK 3000 7839 FRANCIS A KING PRESIDENT ACCOUNTING NEW-YORK 5000 7902 JENNIFER D FORD ANALYST RESEARCH DALLAS 3000 bash2-2.05$ Script done on Thu Sep 5 07:44:19 2002 |
Решение 2:
Script started on Thu Sep 5 07:45:53 2002 bash2-2.05$ grep "000$" ../metod/query1 bash2-2.05$ cat -v ../metod/query1 7369 JOHN Q SMITH CLERK RESEARCH DALLAS 800^M 7499 KEVIN J ALLEN SALESPERSON SALES CHICAGO 1600^M 7505 JEAN K DOYLE MANAGER SALES NEW-YORK 2850^M 7506 LYNN S DENNIS MANAGER SALES DALLAS 2750^M 7507 LESLIE D BAKER MANAGER OPERATIONS NEW-YORK 2200^M 7521 CYNTHIA D WARD SALESPERSON SALES CHICAGO 1250^M 7555 DANIEL T PETERS SALESPERSON SALES NEW-YORK 1250^M 7557 KAREN P SHAW SALESPERSON SALES NEW-YORK 1250^M 7560 SARAH S DUNCAN SALESPERSON SALES DALLAS 1250^M 7564 GREGORY J LANGE SALESPERSON SALES DALLAS 1250^M 7566 TERRY M JONES MANAGER RESEARCH DALLAS 2975^M 7569 CHRIS L ALBERTS MANAGER RESEARCH NEW-YORK 3000^M 7600 RAYMOND Y PORTER SALESPERSON SALES NEW-YORK 1250^M 7609 RICHARD M LEWIS STAFF OPERATIONS DALLAS 1800^M 7654 KENNETH J MARTIN SALESPERSON SALES CHICAGO 1250^M 7676 DENISE D SOMMERS STAFF OPERATIONS CHICAGO 1850^M 7698 MARION S BLAKE MANAGER SALES CHICAGO 2850^M 7782 CAROL F CLARK MANAGER ACCOUNTING NEW-YORK 2450^M 7788 DONALD T SCOTT ANALYST RESEARCH DALLAS 3000^M 7789 LIVIA N WEST SALESPERSON SALES DALLAS 1500^M 7799 MATTHEW G FISHER ANALYST RESEARCH NEW-YORK 3000^M 7820 PAUL S ROSS SALESPERSON SALES BOSTON 1300^M 7839 FRANCIS A KING PRESIDENT ACCOUNTING NEW-YORK 5000^M 7876 DIANE G ADAMS CLERK RESEARCH DALLAS 1100^M 7900 FRED S JAMES CLERK SALES CHICAGO 950^M 7902 JENNIFER D FORD ANALYST RESEARCH DALLAS 3000^M 7916 GRACE M ROBERTS ANALYST RESEARCH NEW-YORK 2875^M 7919 MICHAEL A DOUGLAS CLERK RESEARCH NEW-YORK 800^M 7934 BARBARA M MILLER CLERK ACCOUNTING NEW-YORK 1300^M 7950 ALICE B JENSEN CLERK SALES NEW-YORK 750^M 7954 JAMES T MURRAY CLERK SALES DALLAS 750^M bash2-2.05$ Script done on Thu Sep 5 07:46:12 2002 |
Решение 3:
"000[^0-9]\{0,1\}"
Script started on Thu Sep 5 07:48:12 2002 bash2-2.05$ grep "000[^0-9]\{0,1\}" ../metod/query1 7569 CHRIS L ALBERTS MANAGER RESEARCH NEW-YORK 3000 7788 DONALD T SCOTT ANALYST RESEARCH DALLAS 3000 7799 MATTHEW G FISHER ANALYST RESEARCH NEW-YORK 3000 7839 FRANCIS A KING PRESIDENT ACCOUNTING NEW-YORK 5000 7902 JENNIFER D FORD ANALYST RESEARCH DALLAS 3000 bash2-2.05$ Script done on Thu Sep 5 07:48:15 2002 |
В файле query4 выбрать все строки, в которых дата продажи - весна 1990 г.
Решение:
"[0-9]-[MA][AP][RY]-[0-9]"
bash2-2.05$ grep "[0-9]-[MA][AP][RY]-[0-9]" ../metod/query4 620 TURNER 100 12-MAR-91 4450 526 WEST 221 04-MAR-90 7700 555 WEST 221 04-MAR-91 8540 528 WEST 224 24-MAR-90 3770 558 WEST 224 31-MAR-91 1700 503 SHAW 201 25-MAR-89 1876 562 SHAW 203 04-MAY-91 2044.5 536 SHAW 206 21-MAY-90 2135.6 561 ROSS 207 20-APR-91 2558.3 506 DUNCAN 208 27-APR-89 2600.4 530 DUNCAN 208 03-APR-90 3026.5 557 DUNCAN 208 08-MAR-91 2461.8 bash2-2.05$ Script done on Thu Sep 5 07:51:47 2002 |
© life-prog.ru |
|