Open .csv by specifying column widths on command line

I've got some csv files to work with. They contain fields which are quite long, and opening them with LO results in very large columns, which are difficult to handle. Setting the column width by hand also has me enabling line wrapping to show the full cell content.

I'm looking for a way to open those files by specifying my intended column width and by enabling line wrapping.

e.g. this is the way to open files with custom input filter parameters:
soffice --infilter=CSV:44,34,UTF8 file.csv

what I need is a way to also specify column widths and enable line wrapping.

If this helps, I think I've narrowed down the scope to:
core/sc/source/ui/dbgui and core/sc/source/ui/inc
but I may be wrong.

Hi,

e.g. this is the way to open files with custom input filter parameters:
soffice --infilter=CSV:44,34,UTF8 file.csv

what I need is a way to also specify column widths and enable line wrapping.

My suggestion would probably be to use a python script to get LO running
and waiting for a connection (using the URP connection port), then
formatting your column widths using the appropriate python-UNO objects
after the CSV has been loaded into a Calc sheet. That way, at least in
theory, you wouldn't have to intervene at all in the GUI. You should
also be able to save the file as an ODS.

Another alternative would be to do something similar using python to
load a Calc template containing the required formatting, and then copy
your CSV values (range of cells) into that loaded Calc document. Again,
all of this should be doable without having to intervene via the GUI.

I don't know how to write such a script, as I'm not familiar enough with
python to do so.

Alex

Hi,

e.g. this is the way to open files with custom input filter parameters:
soffice --infilter=CSV:44,34,UTF8 file.csv

what I need is a way to also specify column widths and enable line wrapping.

My suggestion would probably be to use a python script to get LO running
and waiting for a connection (using the URP connection port), then
formatting your column widths using the appropriate python-UNO objects
after the CSV has been loaded into a Calc sheet. That way, at least in
theory, you wouldn't have to intervene at all in the GUI. You should
also be able to save the file as an ODS.

Another alternative would be to do something similar using python to
load a Calc template containing the required formatting, and then copy
your CSV values (range of cells) into that loaded Calc document. Again,
all of this should be doable without having to intervene via the GUI.

I don't know how to write such a script, as I'm not familiar enough with
python to do so.

Alex