taviso / 123elf

A native port of Lotus 1-2-3 to Linux.
1.16k stars 59 forks source link

question around using 1-2-3 to view live data? #90

Closed jibanes closed 2 years ago

jibanes commented 2 years ago

Is it possible to "push" some data to a running 1-2-3 session from an external binary? And refresh 1-2-3 automatically (i.e. view live data)

taviso commented 2 years ago

That's an interesting question. Normally you would manually pull fresh data with a macro and bind it to Alt+R or something - but I can see why you might want to push it instead.

I think the answer is no, but I think we could add this.

You can call a macro anything you want, but if you use the special names \A - \Z they get bound to keys.

If you call it \1, we could bind it to SIGUSR2?

That way you can have an external script run kill -USR2 $(pidof 123) or whatever, and your update macro is run the next time you're in READY mode. I think (famous last words...) this would be easy to add.

jibanes commented 2 years ago

oh that's very interesting

On Tue, Jun 14, 2022 at 11:23 AM Tavis Ormandy @.***> wrote:

That's an interesting question. Normally you would manually pull fresh data with a macro and bind it to Alt+R or something - but I can see why you might want to push it instead.

I think the answer is no, but I think we could add this.

You can call a macro anything you want, but if you use the special names \A - \Z they get bound to keys.

If you call it \1, we could bind it to SIGUSR2?

That way you can have an external script run kill -USR2 $(pidof 123) or whatever, and your update macro is run the next time you're in READY mode. I think (famous last words...) this would be easy to add.

— Reply to this email directly, view it on GitHub https://github.com/taviso/123elf/issues/90#issuecomment-1155549366, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALDEST52MOI7YCBV4F4ZB3VPDE2XANCNFSM5YYQTSOA . You are receiving this because you authored the thread.Message ID: @.***>

taviso commented 2 years ago

I think this works now!

Create a macro that updates the data, then name it \1 (use /Range Name Create)

For example, maybe you're importing data with /File Import, so your macro would look like {GOTO}A5~/fin{CE}/path/to/input.txt~)

Now do kill -USR2 $(pidof 123) in your script, and 1-2-3 will execute that macro the next time it is in READY mode!

jibanes commented 2 years ago

Excellent, thank you!

On Tue, Jun 14, 2022 at 10:40 PM Tavis Ormandy @.***> wrote:

I think this works now!

Create a macro that updates the data, then name it \1 (use /Range Name Create)

For example, maybe you're importing data with /File Import, so your macro would look like {GOTO}A5~/fin{CE}/path/to/input.txt~)

Now do kill -USR2 $(pidof 123) in your script, and 1-2-3 will execute that macro the next time it is in READY mode!

— Reply to this email directly, view it on GitHub https://github.com/taviso/123elf/issues/90#issuecomment-1156011132, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALDESTNTOLG6RDVKQ6Y3R3VPFUFVANCNFSM5YYQTSOA . You are receiving this because you authored the thread.Message ID: @.***>

jibanes commented 2 years ago

Do you know if we can we update multiple cells at once? Or better, can an external program (i.e the one updating input.txt) can chose which cell to update? This cell to update could be in another file per say, or whatever is more convenient.

On Tue, Jun 14, 2022 at 11:55 PM Jerome Ibanes @.***> wrote:

Excellent, thank you!

On Tue, Jun 14, 2022 at 10:40 PM Tavis Ormandy @.***> wrote:

I think this works now!

Create a macro that updates the data, then name it \1 (use /Range Name Create)

For example, maybe you're importing data with /File Import, so your macro would look like {GOTO}A5~/fin{CE}/path/to/input.txt~)

Now do kill -USR2 $(pidof 123) in your script, and 1-2-3 will execute that macro the next time it is in READY mode!

— Reply to this email directly, view it on GitHub https://github.com/taviso/123elf/issues/90#issuecomment-1156011132, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALDESTNTOLG6RDVKQ6Y3R3VPFUFVANCNFSM5YYQTSOA . You are receiving this because you authored the thread.Message ID: @.***>

taviso commented 2 years ago

Hmm - I guess the 1-2-3 way to do this would be to use a lookup table!

If you generate your data like this (this is just some nonsense example data):

$ cat data.csv 
"Name","Value","Variance"
"Temperature",42000,0.96
"Density",36123,0.45
"Viscosity",99145,0.12

Now import that data with /File Import Numbers, and your dashboard can find the "Temperature" value with @VLOOKUP("Temperature",A1..C4,1).

I would read the data into one sheet, then have the dashboard on another!

jibanes commented 2 years ago

Thank you!

On Wed, Jun 15, 2022 at 8:55 AM Tavis Ormandy @.***> wrote:

Hmm - I guess the 1-2-3 way to do this would be to with a lookup table!

If you generate your data like this (this is just some nonsense example data):

$ cat data.csv "Name","Value","Variance" "Temperature",42000,0.96 "Density",36123,0.45 "Viscosity",99145,0.12

Now your dashboard can find the "Temperature" value with @VLOOKUP("Temperature",A1..C4,1).

I would read the data into one sheet, then have the dashboard on another!

— Reply to this email directly, view it on GitHub https://github.com/taviso/123elf/issues/90#issuecomment-1156648979, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALDESRFHFZFYSBRWLLVMWTVPH4IJANCNFSM5YYQTSOA . You are receiving this because you authored the thread.Message ID: @.***>