We will be migrating from Ask to Discourse on the first week of August, read the details here

Ask Your Question
1

tsv as extension option when saving files

asked 2020-09-11 17:02:45 +0200

laserhedvig gravatar image

Is there a way of adding "tsv" as a file type available in the dropdown menu when saving a spreadsheet in calc? I understand how to specify details regarding value and field delims in the "Export as text file" dialogue box, I would just like the option to be there to select "tsv" already the step before, and for this to trigger tab as sep by default.

As it is now, I save as "csv", but with tab as separator and then manually go in and change the file extension.

Grateful for any help!

edit retag flag offensive close merge delete

Comments

You can post an enhancement request at https://bugs.documentfoundation.org/e...

LeroyG gravatar imageLeroyG ( 2020-09-14 01:55:25 +0200 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2020-09-14 01:05:16 +0200

igorlius gravatar image

updated 2020-09-14 01:50:49 +0200

Hello,

i did not find a way to extend the existing save types, but i still wanted to help you out. Here is what i came up with.

First import the following macro ("Tools" -> "Macros" -> "Edit Macros.." ) It can save any open csv file as a "real" tsv file with the same name and location but tsv extension.

Sub SaveTSV
  Dim args(1) as new com.sun.star.beans.PropertyValue
  args(0).Name = "FilterName"
  args(0).Value = "scalc: Text - txt - csv (StarCalc)"
  args(1).Name = "FilterOptions"
  args(1).Value = "9,34,0,1,1/5/2/1/3/1/4/1"
  Dim parts 
  parts = Split(ThisComponent.getUrl(),".")
  Dim ext
  ext = parts(UBound(parts))
  if ( ext = "csv" ) then
    Dim newname
      for i = LBound(parts) to UBound(parts) -1
        newname = newname & parts(i)
      next
    ThisComponent.storeToURL(newname & ".tsv",  args())
  endif
End Sub

Second bind any Keyboard Key (for example any Function-key) that you like to call that macro. Like this:

image description image description

This should allow you to save a tsv copy of any opend csv very quickly I know it's not what you requested, but maybe it's still useful for you.

Hope that helps.

To show the community your question has been answered, click the ✓ next to the correct answer, and "upvote" by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

Have a nice day and let's (continue to) "Be excellent to each other!"

Ask / Getting Started:
https://wiki.documentfoundation.org/A...

edit flag offensive delete link more

Comments

Thanks! I really appreciate the effort. It's indeed not really what I wanted, but it is something. Thank you for your kindness.

laserhedvig gravatar imagelaserhedvig ( 2020-09-14 12:49:20 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-09-11 17:02:45 +0200

Seen: 311 times

Last updated: Sep 14 '20