Swap Two Columns
Each line of pairs.csv is two words with a comma between them, like ada,boston. Print every line with the two swapped: boston,ada.
Example 1
pairs.csv
ada,boston ben,miami
prints
boston,ada miami,ben
Constraints
- Up to 12 lines
Write it in your browser, against the clock. The model script, with a note on each command it uses, comes after.
More Bash problems
- The Longest LineMedium
- The Most Common WordMedium
- Busiest VisitorsHard
- Lines of CodeHard
- Only in the FirstHard
- Share of ErrorsHard
- Shift Them UpHard
- Sort Into FoldersHard