What i want is to search for the first coloumn of each line using awk.i.e as below:
awk '/aaa/ {printf(<>)}' file_1.txt
The print part (<>) should contain all the values(or coloumns ) in the particular line(here it is: bbbb hhhh) including the spaces between each arguments.Given that the "aaa" should not be printed.
In short my output after running the above awk should be
bbbb hhhh
If it is the "vvvv" am searching for then the result should be
mmmmm iiiii
Dear God .. I never meant anything unpolite ..I just said how it worked out .. And i was in a very tight situation yesterday that i missed to put the thanks .. Sorry for that. .
but code doesnot print the spaces in the begining .. Also when i ran this in command promt other than the starting spaces everything else is working .. But am supposed to run this in a script where the pattern is received from a function call .. When i executed the script, i got error saying unamatched ..
The fields in the file are unique ..Nothing is repeated ..Also the pattern for matching is always at teh first of coloumn in my file ..