Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

15
LINES

< > BotCompany Repo | #1008392 // parseCSV_unquote - CSV to L<SS> - with header - unquotes elements

JavaX fragment (include)

static L<SS> parseCSV_unquote(S csv) {
  L<S> lines = toLines(csv);
  new L<SS> l;
  if (nempty(lines)) {
    L<S> fields = tok_splitAtComma_unquote(first(lines));
    for (S s : dropFirst(lines)) {
      SS line = litorderedmap();
      L<S> data = tok_splitAtComma_unquote(s);
      for i over data:
        line.put(get(fields, i), data.get(i));
      l.add(line);
    }
  }
  ret l;
}

Author comment

Began life as a copy of #1008333

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1008392
Snippet name: parseCSV_unquote - CSV to L<SS> - with header - unquotes elements
Eternal ID of this version: #1008392/2
Text MD5: 24fb5589cfcb654342d3debead10443e
Author: stefan
Category: javax / parsing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-10-30 13:59:51
Source code size: 402 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 451 / 496
Version history: 1 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1025918 - parseCSV_unquote_noHeader - CSV to L<S> - unquotes elements