…One of awk's most fundamental concepts is that its input and…output consist of records and each record is divided into fields.…But how does awk define a record and a field?…It's actually very flexible, which is good, because you'll encounter…a wide variety of file formats in the real world.…By default, awk considers each line of its…text input to be a record, and whitespace, any…string of spaces and/or tabs, marks the end…of one field and the beginning of the next.…For example, this awk program tells awk to print the second field on each line.…
Now, if we separate our fields with a…space, one, space, two, space, three, it prints, two.…If we use a tab character, one, tab, two, tab, three, it also prints, two.…You can also use several spaces or tabs in a row.…One, space space space, two, space space space, tab, three.…Or you can use a mix of spaces and tabs.…One, space, tab, space, two, tab tab space, tab tab three.…As you may recall from the last chapter, the capital F command…line flag tells awk to use the following argument as a field separator.…
Author
Released
5/21/2014In this course, award-winning author and teacher David D. Levine shows you how to use AWK to read and write data in a variety of formats, produce reports, and automate repetitive tasks. He reviews the nuts and bolts of the language, such as field separators, pattern matching, variables, operators, expressions, and control structures; functions available for manipulating data; and integration with other programs like Excel.
- Determine what AWK is.
- Recognize how to write an AWK program.
- Determine how to use AWK command-line flags.
- Identify how to specify field and record separators with variables.
- Distinguish how to change a CVS file to a tab-separated one.
- Break down how to work with operators and arrays.
- Discover how to format output.
- Interpret how to string data with functions.
Skill Level Intermediate
Duration
Views
Related Courses
-
Learning Bash Scripting (2013)
with Scott Simpson1h 25m Beginner
-
Introduction
-
Welcome59s
-
-
1. What Is AWK?
-
What is AWK?3m 11s
-
-
2. AWK Command Line Basics
-
Writing an AWK program2m 51s
-
Using AWK command-line flags6m 18s
-
-
3. Understanding Records and Fields
-
4. Understanding Variables and Operators
-
5. A Quick Introduction to Regular Expressions
-
Regular expression basics5m 19s
-
-
6. Using Control Structures
-
Building control structures4m 14s
-
Creating an HTML table4m 45s
-
-
7. Formatting the Output
-
8. Functions and Arrays
-
Manipulating strings7m 28s
-
Using associative arrays4m 55s
-
-
9. Combining AWK with Other Tools
-
Using pipes7m 6s
-
Scripting with AWK4m 56s
-
Challenge: Perform a join1m 13s
-
Solution: Perform a join2m 55s
-
-
Conclusion
-
Goodbye1m 10s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Exploring basic input-field separators