require'tables/dsv'
   ex=: ({.,:,each/@:(,:each)@}.) ',' readdsv 'dept.csv'
   ex
┌──────┬──────────┬──────────┐
│deptno│dname     │location  │
├──────┼──────────┼──────────┤
│10    │Accounting│"New York"│
│20    │Research  │Dallas    │
│30    │Sales     │Chicago   │
│40    │Operations│Boston    │
└──────┴──────────┴──────────┘
   ({.ex), |: <@dtb"1&> {:ex
┌──────┬──────────┬──────────┐
│deptno│dname     │location  │
├──────┼──────────┼──────────┤
│10    │Accounting│"New York"│
├──────┼──────────┼──────────┤
│20    │Research  │Dallas    │
├──────┼──────────┼──────────┤
│30    │Sales     │Chicago   │
├──────┼──────────┼──────────┤
│40    │Operations│Boston    │
└──────┴──────────┴──────────┘

In other words, I expect the headers to be fine "as is", but the body
should be restructured. (And, I assume that all columns within the
body are textual, and that this is desirable.) If I've made a bad
assumption here, about what you're working with at this point, please
let me know.

I hope this helps,

-- 
Raul

On Tue, Aug 23, 2022 at 1:03 PM Pawel Jakubas <jakubas.pa...@gmail.com> wrote:
>
> Thanks for the answers.
> And how would you can go from
>
> ┌──────┬──────────┬────────┐
> │deptno│dname     │location│
> ├──────┼──────────┼────────┤
> │10    │Accounting│New York│
> │20    │Research  │Dallas  │
> │30    │Sales     │Chicago │
> │40    │Operations│Boston  │
> └──────┴──────────┴────────┘
>
> to
>
> ┌──────┬──────────┬──────────┐
> │deptno│dname     │location  │
> ├──────┼──────────┼──────────┤
> │10    │Accounting│"New York"│
> ├──────┼──────────┼──────────┤
> │20    │Research  │Dallas    │
> ├──────┼──────────┼──────────┤
> │30    │Sales     │Chicago   │
> ├──────┼──────────┼──────────┤
> │40    │Operations│Boston    │
> └──────┴──────────┴──────────┘
>
> ? So the other way around.
>
> Thanks in advance and cheers,
>
> Pawel
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to