gsutil - 正则表达式与替代不工作
I am looking to synchronize content between Google bucket and my local directory. I want to ignore certain files while performing this operation.
我希望同步Google存储桶和我的本地目录之间的内容。我想在执行此操作时忽略某些文件。
Like I want to ignore file which ends with country.csv and version.csv at the end.
就像我想忽略最后以country.csv和version.csv结尾的文件。
So I use following regex, which doesn't work
所以我使用以下正则表达式,这是行不通的
gsutil -m rsync -x ".*country\.csv$|.*version\.csv$" gs://[bucket_id] test/
I have tested this regex on regex101.com
我在regex101.com上测试了这个正则表达式
On the other hand when I try with single regex, it works
另一方面,当我尝试使用单一正则表达式时,它可以工作
gsutil -m rsync -x ".*country\.csv$" gs://[bucket_id] test/
I am working on windows machine. And I am referring gsutil documentation
我正在使用Windows机器。我指的是gsutil文档
Can any one identify where the problem is ?
任何人都可以确定问题所在吗?
Edit :
Error on gsutil "not recognized as internal or external command, operable program or batch file"
gsutil错误“无法识别为内部或外部命令,可运行程序或批处理文件”
1 个解决方案
#1
2
This ought to work:
这应该工作:
gsutil -m rsync -x ".*country\.csv$^|.*version\.csv$" gs://[bucket_id] test/
See eg How to pass a quoted pipe character to cmd.exe?
请参阅例如如何将带引号的管道字符传递给cmd.exe?
更多相关文章
- 使用python api递归计算每个Dropbox文件夹大小
- 如何在python中播放wav文件?
- python多线程文件传输范例(C/S)
- Python - 将值打印到新文件?
- 如何让TkInter文件选择对话框与IPython / Spyder一起使用?
- 用python将二进制整数或字符串写入文件
- 使用pandas read_table读取csv文件
- Python -在文本文件中添加日期戳
- 在读取和评估文件列表时加速Python eval。