Hello Gurus,
Please help me out of the problem. I ve a input file as below
input clock;
input a; //reset all
input [9:0] b;
//input comment
output c;
output d;
output [1:0] e;
input [4:0] f;
//output comment
I need the output as follows:
\\Inputs
clock
a
b
f[4:0]
\\Outputs
c
d
e[1:0]
I tried with the following code:
gawk '\
{
gsub(/(^ *|^\t)/, "", $0) \\ for cutting one or more space OR tab
if( match($0,/^input/) ){
print $0 > "del1"
}
if( match($0,/^output/) ){
print $0 > "del2"
}
}' file
then merge del1 & del2 perhaps would give the output. then I need to delete the files del1 and del2.
Is there any other simple way ?
Waitting for your reply