I have a bunch of coordinates given in a file. The file contains Startpoints and Endpoints of arrows in columns(Example):
t start1 end1 start1 end2
1 1 2 2 2 0 0 1 1
2 0 0 1 4
Where the number of arrows is not constant over time. I tried to read the file like this and it did not work (especially the No_of_columns which gives the number of columns for a given row should depend on the row number as each row does not contain the same number of coordinates):
{{#1, #2}, {#3, #4}} & @@@ #[[All, 1 ;; No_of_columns(row) ;; 4]] &/Arrows;
I could also output another file stating the number of coordinate pairs in each row:
t No_of_arrows
So basically I need a matrix whose column number is not the same for all rows. Is that even possible?
EDIT:
https://www.dropbox.com/s/xuuc6v0az73k49e/arrows.txt
EDIT2:
I will try to be more specific. I created (with a lot of help) a code animating rectangles movement in 2D. In the next step I want to connect those rectangles by arrows. Importantly those arrows come and go so that I would have to give another file stating the number of arrows at each time point (maybe?).
So for now I need data looking like this (?)
Arrow_coordinates={{{{1,2},{2,2}},{{0,0},{1,1}}},{{{0,0},{1,4}}}}
In this case I could run an animation with 2 arrows in the first step and 1 in the second step.
{{#1, #2}, {#3, #4}} & @@@ #[[All, 1 ;; -1 ;; 4]] &/@Arrows
? $\endgroup$