The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-27-2006
newlearner newlearner is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 8
Help Needed - print mutliple lines

I have the following input

-- appl = host = user = / pid = 76 elapsed = 0.000 seconds server_elapsed = 2.999
select emp_no, dept_no
from emp
where empname like 'Rob%'
and empno=10
;

-- appl = host = user = / pid = 76 elapsed = 0.000 seconds server_elapsed = 0.999
select emp_no, dept_no
from dept
where deptname like 'IT%'
;

The above input need to print the following output.

2.999 |select emp_no, dept_no from emp where empname like 'Rob%' and empno=10;
0.999 |select emp_no, dept_no from dept where deptname like 'IT%' ;

I have files with thousands of statements, I need to format them as above.

I appreciate your kind help and reply.