Befunge-98 (PyFunge), 22 21 bytes
'[,1#v&." |",,
,]'@j<
If there weren't weird restrictions on output, we could do this in 18:
'[,1#v&.'|,
,]'@j<
'[,1#v&." |",,
,]'@j<
If there weren't weird restrictions on output, we could do this in 18:
'[,1#v&.'|,
,]'@j<