Monday, 17 June 2013

Features of AWK and SED

1. Both are scripting languages, bcz they support automation.

2. Both work primarily with text files SED primarly used for search and

 replace & AWK allows to match various columns  Matching text, 
search and replace etc also.
3. Both are programmable editors.

4. Both accept command-line options (-f script_file)

5. Sed loops through all input lines of input stream or file
     Sed accepts input on.from: STDIN(keyboard),File, pipe(|)
6. sed supports address to indicate which lines to operate on:
     /^$/d -- delete blank lines from a file
^ followed by a $ sign means blank lines. and action performed here is "d" means delete. It will delete all blank lines from the file.

7. AWK is a field processor, based on whitespace, means single spaces, tab so on. AWK is used for extracting specific columns from data feeds.

8. AWK supports programming constructs: loops(for,while,do)

9. conditions (if,then,else)

10. arrays(lists). Functions(string,numeric,user-defined)

No comments:

Post a Comment