Easy as a one-liner:
perl -lane 'print join ",", map qq("$_"), @F[0, 1]'
-lhandles newlines inprint-nreads the input line by line-asplits each line on whitespace into the@Farray@F[0, 1]is an array slice, it extracts the first two elements of the@Farraymapwraps each element in double quotesjoininserts the comma in between
5
solved Perl To Parse Whitespace Separated Columns