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

15
LINES

< > BotCompany Repo | #1008333 // parseCSV_noUnquote - CSV to L<SS> - does not unquote elements

JavaX fragment (include)

1  
static L<SS> parseCSV_noUnquote(S csv) {
2  
  L<S> lines = toLines(csv);
3  
  new L<SS> l;
4  
  if (nempty(lines)) {
5  
    L<S> fields = splitAtComma(first(lines));
6  
    for (S s : dropFirst(lines)) {
7  
      SS line = litorderedmap();
8  
      L<S> data = splitAtComma(s);
9  
      for i over data:
10  
        line.put(get(fields, i), data.get(i));
11  
      l.add(line);
12  
    }
13  
  }
14  
  ret l;
15  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1008333
Snippet name: parseCSV_noUnquote - CSV to L<SS> - does not unquote elements
Eternal ID of this version: #1008333/3
Text MD5: 8565437c1c004b11aa72bc4d7290a9a8
Author: stefan
Category: javax / parsing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-09-08 07:27:17
Source code size: 380 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 511 / 539
Version history: 2 change(s)
Referenced in: [show references]