jisha
January 7, 2008, 11:19pm
1
Hi,
I have a abc.txt file.
In this file there is a SQL query which Iwant to copy and print it on another file.The query (for eg) is written like this:
SELECT field1,
field2,
field3
from table1,table2
where <conditions>
END
I want to copy this query to another file using AWK.Its very urgent .Can someone help me in this.
Thanks in advance.
JS
jisha:
Hi,
I have a abc.txt file.
In this file there is a SQL query which Iwant to copy and print it on another file.The query (for eg) is written like this:
SELECT field1,
field2,
field3
from table1,table2
where <conditions>
END
I want to copy this query to another file using AWK.Its very urgent .Can someone help me in this.
Thanks in advance.
JS
awk '/SELECT/,/END/{print}' abc.txt > newfile
jisha
January 7, 2008, 11:57pm
3
Thanku so much its working perfectly !!
jisha
January 8, 2008, 12:04am
4
What If i dont want to print the first and the last line but everthing else?
For eg : I dont want to print the SELECT and Last line, END but have to print all lines in between these two?