Re: convert list into table

Giovanni Piredda <[email protected]>
Newsgroups gmane.editors.texmacs.user
Message-ID <[email protected]>
I put on tm-forge a plugin that _almost_ does what you want. It is 
called csv-table.

I am planning to improve it in the next few weeks, making it adherent to 
the csv format specifications, but I still have the impression that it 
will do something slightly different from what you ask. I can send you 
the code for the improved version; I think it works, I need to test it 
once more and to improve the documentation before putting it on tm-forge 
(and maybe something that I am forgetting).

On to the (IMO) important detail, what would you like to do with the 
list in brackets (square parentheses)? Should it go in a single cell, or 
each element in its own cell?

Finally, with Scheme it is pretty straightforward to transform your 
collection of lists into a table; you have to

- process the brackets so that they are transformed into something that 
Scheme deals with easily

- add a cell tag in front of each element, a row tag in front of each 
row, a table tag in front of the collection.

This would make something that works for the lists you posted and may 
not work for other lists.

Let me know.

Giovanni

On 02/03/24 17:28, vincent douce wrote:
> hello
> i’v got this list from python
>
> (3388, 490, 14, [448, 42, 28, 14])
> (588, 77, 7, [49, 28, 21, 14, 7])
> (4410, 154, 14, [98, 56, 42, 28, 14])
> (2772, 1815, 33, [957, 858, 99, 33])
> (2205, 165, 15, [60, 45, 30, 15])
> (21175, 7986, 121, [5203, 2783, 2420, 726])
> (198, 121, 11, [77, 44, 33, 22, 11])
> (630, 396, 18, [234, 162, 72, 36])
> (7350, 539, 49, [343, 196, 147, 98, 49])
> (3675, 990, 15, [705, 285, 135, 45])
> (140, 11, 1, [8, 3, 2, 1])
> (6468, 3630, 66, [2838, 792, 462, 396, 66])
> (847, 495, 11, [352, 143, 66, 33])
> (220, 175, 5, [45, 40, 15, 10, 5])
>
> that’s exercises for arithmetic
>
> i want to present them into a TeXmacs’ table or tabular
> is there an automatic way to do it ?
>
> Vinz
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.