Can I operate LO Calc and feed a .csv from different appln or command line?

Season’s Greetings!
Question in short is in the subject. What follows is my attempt to explain something I am not really clear about!
So, basically I want to :
(1) store plenty of formulae in a Calc “formulae.ods” file which expect input from a “temp.csv”,
(2) “feed” 1000 different csv files one-by-one by moving last 250 lines (or so to avoid unnecessary calculation) and naming each short new .csv as “temp.csv” and invoking formulae.ods each time
(3) saving one-by-one the 1000 diff calculations as 1000 diff csv files - one for each input file.
Problem:
I do not want to manually open, save as/export results and close LO Calc 1000 times.
I would like to ideally open, save as, and close the formulae.ods from a shell script and loop it 1000 times.
Actually whichever way I try to crack this it seems an inefficient way :frowning: but for the time being I would be happy if I can execute the above steps.

The use of Database has been recommended to me but I am worried about the 4 letter word L-A-M-P. Besides then I will have to keep tracking changes and porting every time higher version is introduced. Hopefully scripting is stable and basic enough not to change very often. I am sort of (!?) reluctant (afraid is more like it) to move from being a user to an application developer/ database programmer. Thanks for your patience…

Please take a look to this threads:

Thanks for the reply. I did check that thread. That problem is diff and the solution is in BASIC. I want to create/update say 1000 different result???.csv files from 1000 different input???.csv by processing the input files using Calc. I could process them using C but I will have to write all the formulae. I can’t replicate the math functions. So I was thinking - (1) Get input_ppp.csv (2) strip last 250 lines and rename as temp.csv (3) open formulae.ods by a command as against manually (4) formulae.ods will have formulae programmed to expect input from temp.csv (5) Save formulae.ods calculated results in a result_ppp.csv (6) close input_ppp, result_ppp.csv (7) loop ppp from 000 to 999 and gather result_000.csv to result_999.csv => Since I update the 1000 input files from a single file using a shell script I was hoping to open, close, and save as the formulae.ods through Calc. I will go through the details of BASIC program, I might get some ideas from there … Thanks, Regards,