|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
AWK - Hard to understand for me
Hi All, I have googled and spent few hours to understand about AWK usage... But still not very much clear.... Upto my understanding 'AWK' deals with files... It reads the file takes it as a input process it and gives output or writes the output to an another file... >> Please correct me if I am wrong OR make me more clear and precise ![]() When I tried executing below command in the command prompt Code:
awk' '{print$1}' SNA_DB_UPG.listIt does not take this as a command and further seeking for a terminator... ![]() Further I felt better to give some file to print the output as below: Code:
awk' '{print$1}' SNA_DB_UPG.list >> testBut Alas no luck.. ![]() Please share few more examples... I gone through with older posts as well.. But nothing clicked me.. ![]() Thanks in Advance: Ambar |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
we need to give space between the print and $1 Code:
print $1 |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
But still .. after giving space also .. It is not working for me..
![]() |
|
#4
|
||||
|
||||
|
just noticed.. please remove the highlighted single quote Code:
awk' '{print $1}' SNA_DB_UPG.list |
| The Following User Says Thank You to itkamaraj For This Useful Post: | ||
ambarginni (03-15-2012) | ||
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
Thanks itkamaraj
Now it worked!! Thank you very much...
But can you please elaborate me with the logic as well.. As i am trying to understand the 'AWK'... what is all about - I know it is huge topic but the basic understanding so that I can read it further in google ![]() Thanks again itkamaraj.. I really feel good after executing my first command using 'awk' ![]() |
| Sponsored Links | |
|
|
#6
|
||||
|
||||
|
you can learn more in this page ( very good for awk and sed commands )
Awk - A Tutorial and Introduction - by Bruce Barnett Welcome to The UNIX Grymoire! |
| Sponsored Links | |
|
|
#7
|
|||
|
|||
|
When I executed the below code in command prompt again the same problem.... Seeking for a delimiter and not taking the below as a executable code Code:
BEGIN { print "SNA_DB_UPG.list"," }
{ print $8, "\t", $3}
END { print " - DONE -" }It is requested to please explain me. |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| can't understand! | nikki1200 | Shell Programming and Scripting | 3 | 08-12-2011 04:29 AM |
| C++ Code to Access Linux Hard Disk Sectors (with a LoopBack Virtual Hard Disk) | shen747 | Linux | 23 | 01-28-2011 09:27 PM |
| trying to understand what sed is doing? | TheBigAmbulance | Shell Programming and Scripting | 2 | 06-29-2009 02:07 PM |
| The best partitioning schem for a 250GB Sata hard drive & a 75GB SCSI hard drive | sirbijan | Filesystems, Disks and Memory | 0 | 04-05-2006 02:19 PM |
|
|