Start a shell duckdb
-- creates a new in memory table for your data
create table mydata as select * from 'myfile.csv';
-- do SQL stuff to your data
update mydata set name = 'foo' where name = 'bar';
copy (from mydata) to 'myfile_updated.csv';
-- exit the shell
.q
Or if you are brave you can use the commandline directly
duckdb :memory: -c "COPY (SELECT * FROM 'myfile.csv' WHERE name = 'foo') TO 'myfile_updated.csv')"