nerdexam
CompTIA

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…

System Management

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)
  • A
    91% (53)
  • B
    2% (1)
  • C
    5% (3)
  • D
    2% (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

#awk#text processing#CSV parsing#command line utilities

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice