aej1973
IS-IT--Management
- Apr 24, 2008
- 1
Hi, I have a text file as shown below. I need to use the awk utility and get the following output;
************required output****************
886-1 first_name monthly_amt tax_amt
886-2 first_name monthly_amt tax_amt
886-3 first_name monthly_amt tax_amt
********************************************
The main file is in the folloing format:-
*********Main file format*************
8861-1 first_name;last_name street#
monthly_amt balance_due late_fee
tax_amt packages
8861-2 first_name;last_name street#
monthly_amt balance_due late_fee
tax_amt packages
8861-3 first_name;last_name street#
monthly_amt balance_due late_fee
tax_amt packages
***************************************
I use the following script to pull up info from the first line;
cat ./sedFinal.txt |awk '/886/{print $1,$2}'|more
but I need to pull up info from multiple lines. How can this be done? Thanks for the help.
A
************required output****************
886-1 first_name monthly_amt tax_amt
886-2 first_name monthly_amt tax_amt
886-3 first_name monthly_amt tax_amt
********************************************
The main file is in the folloing format:-
*********Main file format*************
8861-1 first_name;last_name street#
monthly_amt balance_due late_fee
tax_amt packages
8861-2 first_name;last_name street#
monthly_amt balance_due late_fee
tax_amt packages
8861-3 first_name;last_name street#
monthly_amt balance_due late_fee
tax_amt packages
***************************************
I use the following script to pull up info from the first line;
cat ./sedFinal.txt |awk '/886/{print $1,$2}'|more
but I need to pull up info from multiple lines. How can this be done? Thanks for the help.
A