Open .csv by specifying column widths on command line

I think there is a workaround, which may or may not be helpful.

o Start a fresh spreadsheet.
o Adjust the column widths as desired.
o Format relevant cells to "Wrap text automatically".
o Save as a template.

To use:
o Open CSV fie normally.
o Select all (Edit | Select All, or Ctrl+A, or click the rectangle at top left where the row and column headers meet) or relevant cell range.
o Copy.
o Open new spreadsheet based on template.
o Click cell A1 or select all (as above).
o Paste, but using Edit | Paste Special (or Ctrl+Shift+V) instead of normal Paste. In the Paste Special dialogue, ensure that Formats is *not* ticked.

I trust this helps.

Brian Barker

Thanks Brian for your reply, unfortunately that does not help me.

What I'm looking for is a way to work with csv files with minimum hassle.
I do not need features such as column widths, other formatting etc. to be saved in the file(s).
I just need to specify the way LO displays csv files when they are opened (as command line arguments so I can automate that).

Your proposed workaround would require manual adjustments, on a file by file basis, and each time they are opened.
These manual steps are what I'm looking to avoid. Else I could just resize the columns and enable wrapping every time and be done with this.

Would this work in your command line mixed with Brians' idea?

-n {filename} Creates a new document using *{filename}* as a template.

From: https://help.libreoffice.org/Common/Starting_the_Software_With_Parameters

There may be another answer.

I import semi-colon (:wink: separated data into Writer, recorded Macro filters and tied them together. In my case, I made a Menu which reformat the data fields.

See the example below from URL: https://ask.libreoffice.org/en/question/150565/execute-macro-in-calc-from-terminal/