g | x | w | all
Bytes Lang Time Link
222005AB1E240527T105804ZKevin Cr
061APL+WIN240526T113114ZGraham
031sed240525T204337ZJan Blum
068Rust240524T122554ZSylveste
020Charcoal240525T072201ZNeil
nanVyxal240524T182728Zpacman25
059Python 3240524T120239ZSylveste
8984Google Sheets240524T132343Zz..
102Go240524T181728Zbigyihsu
075AWK240524T175448ZC K
035Perl 5 p0240524T152641ZXcali
051JavaScript ES6240524T121103ZArnauld
058JavaScript Node.js240524T111834Zcorvus_1
025Retina240524T111430Zcorvus_1

05AB1E, 22 (or 20) bytes

|',„||:'-.ý'}ª'|ì„{|š»

Input-lines as separated inputs.

Try it online.

: If we're allowed to use a list of lines as I/O, it could be -2 bytes by removing the leading | and trailing »:
Try it online.

Explanation:

|                       # Get all inputs as a list of strings
 ',„||:                '# Replace all "," with "||" in each string
       '-.ý            '# Intersperse it with "-" delimiter
           '}ª         '# Append "}" to the list
              '|ì      '# Prepend "|" in front of each inner string
                 „{|š   # Prepend "{|" to the list
                     »  # Join the list with newline delimiter
                        # (after which the result is output implicitly)

APL+WIN, 61 bytes.

Prompts for CSV as a nested matrix of rows:

m←⎕⋄((∊,m=',')/∊,m)←⊂'||'⋄⊃(⊂'{|'),(¯1↓,('|',¨m),⊂'|-'),⊂'|}'

Try it online! Thanks to Dyalog Classic

sed, 31 bytes

1i{|
1!i|-
s/^/|/
s/,/||/g
$a|}

Try it online!

Rust, 73 bytes 68 bytes

|s|format!("{{|
|")+&s.replace(",","||").replace("
","
|-
|")+"
|}";

Try it online!

Charcoal, 20 bytes

{|¶WS⁺|⟦⪫⪪ι,×|²-⟧M↗}

Try it online! Link is to verbose version of code. Takes input as a list of newline-terminated strings. Explanation:

{|¶

Output the table start.

WS

Loop over each row.

⁺|⟦⪫⪪ι,×|²-⟧

Replace the commas in the row with ||, then print both the row and a -, but prefixing a | to each. (×|² is shorter than || because it doesn't need to be separated from the adjacent strings.)

M↗}

Change the last table row into a table end.

17 bytes to print using the alternative cell format:

{|¶WS⁺|⊞O⪪ι,¦-M↗}

Try it online! Link is to verbose version of code. Takes input as a list of newline-terminated strings. Explanation: As above except each row is split on commas and a - is appended to the list before each element is prefixed with |.

Vyxal, 149 bitsv2, 18.625 bytes

⌐ƛ\|dj\-M;fṪ¤ø.\|vp⁋øḃ

Try it Online!

Bitstring:

00011000001001100101010010010000100010000101001011101000010010010110110010001010110101010011111010101100011110000111011001000010001001111011110011110

-1.5 bytes from doing the dash separator inside the map function

⌐ƛ\|dj;:L‹\-ẋY¤ø.\|vp⁋øḃ­⁡​‎‎⁡⁠⁡‏⁠‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁢‏⁠‎⁡⁠⁢⁣‏‏​⁡⁠⁡‌⁣​‎⁠⁠⁠⁠‎⁡⁠⁢⁢‏⁠‏​⁡⁠⁡‌⁤​‎‎⁡⁠⁣‏⁠‎⁡⁠⁤‏⁠‎⁡⁠⁢⁡‏‏​⁡⁠⁡‌⁢⁡​‎⁠⁠‎⁡⁠⁤⁡‏⁠‏​⁡⁠⁡‌⁢⁢​‎‎⁡⁠⁣⁣‏⁠‎⁡⁠⁣⁤‏‏​⁡⁠⁡‌⁢⁣​‎‎⁡⁠⁢⁤‏⁠‎⁡⁠⁣⁡‏⁠‎⁡⁠⁣⁢‏‏​⁡⁠⁡‌⁢⁤​‎‎⁡⁠⁤⁢‏‏​⁡⁠⁡‌⁣⁡​‎‎⁡⁠⁤⁣‏⁠‎⁡⁠⁤⁤‏⁠‎⁡⁠⁢⁡⁡‏‏​⁡⁠⁡‌⁣⁢​‎‎⁡⁠⁢⁡⁢‏⁠‎⁡⁠⁢⁡⁣‏⁠‎⁡⁠⁢⁡⁤‏⁠‎⁡⁠⁢⁢⁡‏⁠‏​⁡⁠⁡‌⁣⁣​‎‎⁡⁠⁢⁢⁢‏⁠‎⁡⁠⁢⁢⁣‏⁠‎⁡⁠⁢⁢⁤‏‏​⁡⁠⁡‌­
⌐                         # ‎⁡split strings on commas
 ƛ    ;                   # ‎⁢for each row
     j                    # ‎⁣join on the string
  \|d                     # ‎⁤"||"
            ẋ             # ‎⁢⁡repeat the string...
          \-              # ‎⁢⁢"-"
       :L‹                # ‎⁢⁣rows-1 times 
             Y            # ‎⁢⁤interleave with separated list
              ¤ø.         # ‎⁣⁡surround with empty string
                 \|vp     # ‎⁣⁢prepend a \| to each row
                     ⁋øḃ  # ‎⁣⁣join list on newlines and add curly braces to ends
💎

Created with the help of Luminespire.

Python 3, 65 bytes 59 bytes

lambda s:"{|\n|"+s.translate({44:"||",10:"\n|-\n|"})+"\n|}"

Try it online!

Google Sheets, 89 84 bytes

-5 bytes thanks to @doubleunary

="{|
"&REGEXREPLACE(SUBSTITUTE(SUBSTITUTE(A1,",","||"),"
","
-
"),"(?m)^","|")&"
|}"

enter image description here

Go, 102 bytes

import."strings"
func f(s string)string{R:=ReplaceAll
return`{|
|`+R(R(s,",","||"),`
`,`
|-
|`)+`
|}`}

Attempt This Online!

AWK, 75 bytes

BEGIN{x="{|\n"}{gsub(/,/,"||");x=x (1~NR?"|":"-\n|")$0"\n|"}END{print x"}"}

Try it online!

AWK is pretty clear about concatenating strings, so we're just jamming in the extra formatting. Run it thus, with the csv file of choice:

awk 'BEGIN{x="{|\n"}{gsub(/,/,"||");x=x (1~NR?"|":"-\n|")$0"\n|"}END{print x"}"}' data.csv

Perl 5 -p0, 35 bytes

s/
/
|-
|/g;s/,/||/g;$_="{|
|$_
|}"

Try it online!

JavaScript (ES6), 51 bytes

s=>`{|
|${s.replace(/\W/g,c=>1/c?`
|-
|`:`||`)}
|}`

Try it online!

Commented

with funny colors, courtesy of highlight.js

s =>              // s = input string
`{|\n|${          // append the leading string "{|\n|"
  s.replace(      // replace in s:
    /\W/g,        //   because the data fields are guaranteed
                  //   to contain only letters and digits, it
                  //   is safe to use \W to match all commas
                  //   and newline characters at once
    c =>          //   given the matched character c ...
      1 / c ?     //     if c = "\n" (which is zero'ish):
        `\n|-\n|` //       append the row separator
      :           //     else:
        `||`      //       append the column separator
  )               //   end of replace()
}\n|}`            // append the trailing string "\n|}"

JavaScript (Node.js), 58 bytes

s=>`{|
|${s.replace(/,/g,'||').replace(/\n/g,`
|-
|`)}
|}`

Attempt This Online!

Retina, 25 bytes

,
||
¶
¶|-¶|
^
{|¶|
$
¶|}

Attempt This Online!