![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| copy and paste a specific line | tiger99 | Shell Programming and Scripting | 7 | 02-24-2008 07:43 AM |
| VNC copy paste problem | param_it | Windows & DOS: Issues & Discussions | 0 | 07-26-2007 11:43 PM |
| cut, copy + paste | aitor314 | UNIX for Dummies Questions & Answers | 2 | 02-06-2006 01:17 AM |
| copy and paste from MS Windows to Unix | Loaded Gun | UNIX for Dummies Questions & Answers | 9 | 06-02-2003 02:12 AM |
| Cut, Copy and Paste with X | auswipe | UNIX Desktop for Dummies Questions & Answers | 4 | 03-27-2002 12:27 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Code:
sed '/host=atlx3 *sid=atld3 mail=/{;h;s/mail=.*/mail=DISABLE/p;x;s/^/#/;}' abc.txt
|
| Forum Sponsor | ||
|
|
|
|||
|
AU Main Date: 08-SEP-08 10:27:11
Profit and Loss Long Report Page: 1 Current Period: AUG-08 Personal Unit=AU003 (Industrial Products Division),Plant=B00089,Departmant=D110 Ptd-Actual Ptd-Budget Ptd-Variance YTD-Actual YTD-Budget YTD-Variance Account Le BU Pl De In Fu ------------------------------ -- -- -- -- -- -- ------------ ------------ ------------ -------------- ------------- ------------ Operating Distribution 0.00 0.00 0.00 -30,808,210.75 0.00 30808210.75 Cost of Sales/OPNS 180,689.57 0.00 -180,689.57 173818430.54 0.00 -173818430.54 GROSS PROFIT 180,689.57 0.00 -180,689.57 -118521808.49 0.00 118521808.49 Marketing Distrib 0.00 0.00 0.00 0.00 0.00 0.00 Personal Unit=AU004 (Industrial Products Division),Plant=B01189,Departmant=D111 Ptd-Actual Ptd-Budget Ptd-Variance YTD-Actual YTD-Budget YTD-Variance Account Le BU Pl De In Fu ------------------------------ -- -- -- -- -- -- ------------ ------------ ------------ -------------- ------------- ------------ Operating Distribution 0.00 0.00 0.00 -30,808,210.75 0.00 30808210.75 Cost of Sales/OPNS 180,689.57 0.00 -180,689.57 173818430.54 0.00 -173818430.54 GROSS PROFIT 180,689.57 0.00 -180,689.57 -118521808.49 0.00 118521808.49 Marketing Distrib 0.00 0.00 0.00 0.00 0.00 0.00 I need oput where ever i find Personal unit just capture that line and copy that line to make it like Personal Unit=AU003 Plant=B00089 Departmant=D110 -->RAM:AU003:B00089 I am using sed -e '/Personal Unit/{;h;s/^/#/p;x;}' -e '/Business Unit/{s/,Plant/\nPlant/g' -e 's/,Departmant/\nDepartmant/g'} filename But this is not fulfilling my requirement Any one please help me on this |
|
|||
|
Quote:
Grep, then format then prepare a string No duplicate or cross-posting, please read the: Simple rules of the UNIX.COM forums:. Regards |
|||
| Google The UNIX and Linux Forums |