JavaScript · Intermediate · Ticket 4Ticket #22 · from Tomás Reyes, Support Lead
  1. Example
  2. Warm-up 1
  3. Warm-up 2
  4. Ticket
Brief
NEW TICKET#22 · Client import

Read a CSV line with quoted commas

Tomás Reyes · Support Lead
Opened today

“People import their clients from a spreadsheet saved as CSV, and any client with a comma in their name breaks: "Smith, Jones & Co" turns into two columns and everything after it shifts one place. Spreadsheets put a field like that in double quotes, and write a quote inside it as two quotes: "The ""Best"" Bakery". Hannah started parseCsvLine, which already splits on commas character by character; it needs to know when it's inside quotes. Can you finish it?”

YOUR PLAN
  1. 1Watch an example2 min
  2. 2Warm-up 11 min
  3. 3Warm-up 21 min
  4. 4Fix the ticket21 min
BY THE END YOU CAN
  • Walk through text one character at a time
  • Keep a true/false flag for the state you're in
  • Look one character ahead
About 25 minutes
Four short steps. Nothing is timed, and you can leave any time.