awk command help
From: Vish grover (vishal_stud_at_yahoo.com)
Date: 10/27/04
- Next message: Roel Sergeant: "Re: Inserting newline after every 4000 bytes in a file"
- Previous message: Chris F.A. Johnson: "Re: find command problem with return code"
- Next in thread: Jeremiah DeWitt Weiner: "Re: awk command help"
- Reply: Jeremiah DeWitt Weiner: "Re: awk command help"
- Reply: Kenny McCormack: "Re: awk command help"
- Reply: Ed Morton: "Re: awk command help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 27 Oct 2004 12:59:42 -0700
Hi ,
I wanted to write a awk/sed command to (literally)swap two paramaters
of a functions .
So for eg :
func_foo(param1, param2 , param3 , param4, param5);
should be func_foo(param1, param2, param4, param3 , param5);
Here is my simple awk command file "mycmnd.awk":
BEGIN { RS=";" ; FS ="," }
/func_foo\(/{
print $1 "," $2 "," $4 "," $3 "," $5 ";" }
my invocation was
awk -f mycmnd.awk $filename > output.txt
The only problem I have is that only my function with swapped params
shows up. How can I get the contents of the whole .c file in my output
with the appropriate changes.
Thanks in advance,
Regards,
V
- Next message: Roel Sergeant: "Re: Inserting newline after every 4000 bytes in a file"
- Previous message: Chris F.A. Johnson: "Re: find command problem with return code"
- Next in thread: Jeremiah DeWitt Weiner: "Re: awk command help"
- Reply: Jeremiah DeWitt Weiner: "Re: awk command help"
- Reply: Kenny McCormack: "Re: awk command help"
- Reply: Ed Morton: "Re: awk command help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|