XK0-005 · Question #82
A systems administrator needs to retrieve specific fields from a csv file. Which of the following tools would accomplish this task?
The correct answer is A. awk. 'awk' is a powerful text-processing tool designed specifically for working with structured, field-delimited data. It can split records by a custom delimiter (e.g., awk -F',' '{print $2, $4}' file.csv) to extract and print specific columns from a CSV file. 'sort' reorders lines…
Question
A systems administrator needs to retrieve specific fields from a csv file. Which of the following tools would accomplish this task?
Options
- Aawk
- Bsort
- Cprint
- Decho
How the community answered
(58 responses)- A91% (53)
- B2% (1)
- C5% (3)
- D2% (1)
Explanation
'awk' is a powerful text-processing tool designed specifically for working with structured, field-delimited data. It can split records by a custom delimiter (e.g., awk -F',' '{print $2, $4}' file.csv) to extract and print specific columns from a CSV file. 'sort' reorders lines but does not extract fields. 'print' is not a standard standalone Linux command for this purpose. 'echo' outputs text strings but cannot parse or extract fields from a file. awk is the correct and idiomatic tool for this field-extraction task.
Topics
Community Discussion
No community discussion yet for this question.