--drive-allow-import-name-change --drive-import-formats csv,txt not working

UPDATE: I'm really sorry. It seems that I used --drive-export-formats all the way instead of --drive-import-formats and did not notice it! Everything works as expected and the topic can be closed...

What is the problem you are having with rclone?

My issue is similar to the one described in this topic:
How to upload text files to Google Drive as google docs?

I can see that a bug was fixed as per discussion in the topic above and bug fix applied to rclone 1.47, however it only affects .txt being converted to google doc, but not .csv being converted to google sheet as I'd also expect.

I have a local directory test-subfolder with the files test.csv and test.txt there and I want to copy them to google drive so that test.csv become a google sheet and test.txt become a google doc.

I use the following command:

rclone copy -vv --drive-allow-import-name-change --drive-import-formats csv,txt test-subfolder gdrive:test-subfolder

I expect the "test-subfolder" folder on google drive to contain a google sheet and a google doc, however the test.txt becomes a google doc and changes its name to "test" without extention, BUT test.csv is copied with its extensions and its format unchanged.

What is my mistake and why '--drive-allow-import-name-change --drive-import-formats txt,csv' only converts .txt, but not .csv?

What is your rclone version (output from rclone version)

rclone v1.55.1

  • os/type: linux
  • os/arch: amd64
  • go/version: go1.16.3
  • go/linking: static
  • go/tags: none

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Linux ai-domainproject 5.4.0-1045-aws #47~18.04.1-Ubuntu SMP Tue Apr 13 15:58:14 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic

Which cloud storage system are you using? (eg Google Drive)

Google Drive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone copy -vv --drive-allow-import-name-change --drive-import-formats csv,txt test-subfolder gdrive:test-subfolder

The rclone config contents with secrets removed.

[gdrive]
type = drive
scope = drive
root_folder_id = <REMOVED>
token = <REMOVED>

A log from the command with the -vv flag

2021/04/30 22:16:33 DEBUG : Using config file from "/home/r_grg/.config/rclone/rclone.conf"
2021/04/30 22:16:33 DEBUG : rclone: Version "v1.55.1" starting with parameters ["rclone" "copy" "-vv" "--drive-allow-import-name-change" "--drive-import-formats" "csv,txt" "test-subfolder" "gdrive:test-subfolder"]
2021/04/30 22:16:33 DEBUG : Creating backend with remote "test-subfolder"
2021/04/30 22:16:33 DEBUG : fs cache: renaming cache item "test-subfolder" to be canonical "/home/r_grg/test-subfolder"
2021/04/30 22:16:33 DEBUG : Creating backend with remote "gdrive:test-subfolder"
2021/04/30 22:16:33 DEBUG : gdrive: detected overridden config - adding "{/Cg2M}" suffix to name
2021/04/30 22:16:33 DEBUG : fs cache: renaming cache item "gdrive:test-subfolder" to be canonical "gdrive{/Cg2M}:test-subfolder"
2021/04/30 22:16:34 DEBUG : Google drive root 'test-subfolder': Waiting for checks to finish
2021/04/30 22:16:34 DEBUG : Google drive root 'test-subfolder': Waiting for transfers to finish
2021/04/30 22:16:38 INFO  : test2.csv: Copied (new) to: test2.xlsx
2021/04/30 22:16:38 INFO  : test.txt: Copied (new) to: test.docx
2021/04/30 22:16:38 INFO  : 
Transferred:       21.381k / 21.381 kBytes, 100%, 4.519 kBytes/s, ETA 0s
Transferred:            2 / 2, 100%
Elapsed time:         5.4s

2021/04/30 22:16:38 DEBUG : 8 go routines active

hello and welcome to the forum,

the command you posted is not the same as the command in the debug log
posted --drive-export-formats txt,csv

debug --drive-export-formats txt --drive-export-formats txt
this has the same flag twice?

Hello,

Sorry, actually I must use --drive-import-formats not --drive-export-formats! I'm now editing the topic to reflect the change. What I discovered is that test.txt becomes a google doc and it filename gets changed (it loses the extension), but test.csv does not become a google sheet and is kept as test.csv!

Please let me edit the topic with --drive-import-formats and updated logs.

it can get confusing if you re-edit old posts.
so just add a new post with the updated info.....

I'm really sorry. It seems that I used --drive-export-formats all the way instead of --drive-import-formats and did not notice it! Everything works as expected and the topic can be closed...

another bug bits the dust.

to close the topic, find the post that solved it and click solution

Thanks, I clicked on "solution" under your first post (the topic is not closed yet, though). Although it does not mention --drive-import-formats, you mentioned that I used --drive-export-formats instead and I noticed my mistake. Thanks and sorry!

sure, nothing to be sorry about.

now that you marked this topic solved, it will auto-close after three days.

image

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.