Re: [libreoffice-users] Open .csv by specifying column widths on command line

2020-04-08 Thread Paul D. Mirowsky

Calc template files end in .ots

Although I used Writer to make my macros, Writer does not export CSV 
files correctly, or should I say without spaces as Calc does, I guess 
you will have to make your macros in Calc. (Version: 6.3.5.2).


Hope this helps.

On 4/8/20 1:30 PM, edonkey2001-libreoff...@yahoo.it wrote:

Hi Paul,
I've tried to create an ods file to use as template as suggested.
I've set my intended column widths in it, enabled line wrapping, then I saved 
it.

Then I ran:
soffice -n template.ods --infilter=CSV:44,34,UTF8 myfile.csv

Unfortunately what actually happens is that LibreOffice opens two files:
- a new file based on my template, which contains no data
- my csv file, without applying my template to it



--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


Re: [libreoffice-users] Open .csv by specifying column widths on command line

2020-04-08 Thread edonkey2001-libreoffice
Hi Paul,
I've tried to create an ods file to use as template as suggested.
I've set my intended column widths in it, enabled line wrapping, then I saved 
it.

Then I ran:
soffice -n template.ods --infilter=CSV:44,34,UTF8 myfile.csv

Unfortunately what actually happens is that LibreOffice opens two files:
- a new file based on my template, which contains no data
- my csv file, without applying my template to it

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


Re: [libreoffice-users] Open .csv by specifying column widths on command line

2020-04-08 Thread Paul D. Mirowsky

There may be another answer.

I import semi-colon (;) 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/



Also, this simple Sub:



|SubFindSheet(aNumber)MsgBox"Here is the number " EndSub|

run from terminal as:

|libreoffice6.0"macro:///Standard.Module1.FindSheet(4)"|

or on some systems:

|soffice "macro:///Standard.Module1.FindSheet(4)"|

displays the proper variable and message in a message box.

Another note, when executing the macro from terminal and all of LO is 
closed, you will briefly see the LO splash screen displayed.






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.



--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


Re: [libreoffice-users] Open .csv by specifying column widths on command line

2020-04-08 Thread Paul D. Mirowsky

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


On 4/7/20 6:58 AM, edonkey2001-libreoff...@yahoo.it wrote:

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.



--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


Re: [libreoffice-users] Open .csv by specifying column widths on command line

2020-04-07 Thread edonkey2001-libreoffice
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.

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


Re: [libreoffice-users] Open .csv by specifying column widths on command line

2020-04-07 Thread Brian Barker

At 09:18 07/04/2020 +, Nobody Noname wrote:
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.


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


--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy



[libreoffice-users] Open .csv by specifying column widths on command line

2020-04-07 Thread edonkey2001-libreoffice
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.

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy