Linux Labs

Bash: text processing and scripts / Stage 2 of 9

sed and awk: editing and fields of a stream

Not running Starting usually ~20 s
Leave the lesson

Step 6 of 9 · on a machine · 3 min

Refunds by client

Same file, another question — this time you put the command together yourself.

The accountant needs a refund table: which clients got money back in October, and how much. Refunds are marked with the word refund in the last column, status.

Exercise · do it

Build the refund table

In ~/sed-lab, build a refund table from payments.csv and write it to refunds.txt: each line holds a client who got money back and the total of their refunds, separated by a space; the clients in alphabetical order.

Sign in and start The machine is available after signing in

Goals · 0 of 3

  • Write the table to refunds.txt not done yet
  • Add up each client's refunds not done yet
  • Put the clients in alphabetical order not done yet

Step goals

0 of 3
  • Write the table to refunds.txt — not done yet
  • Add up each client's refunds — not done yet
  • Put the clients in alphabetical order — not done yet
Ubuntu 24.04

Step goals

0 of 3
  • Write the table to refunds.txt — not done yet
  • Add up each client's refunds — not done yet
  • Put the clients in alphabetical order — not done yet
Loading…