这些是我的原始文件名:
C003.png
C004.png
C005.png
C006.png
...
我希望我的脚本通过添加前缀-1
来修改文件名,并将原始文件名保留在第一位:
C003-1.png
C004-1.png
C005-1.png
C006-1.png
...
如何在批处理脚本上进行此操作?
答案 0 :(得分:1)
您只需要这样做:
(envname) username@computername:~/projects/myproject$ conda list
# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<
Traceback (most recent call last):
File "/home/username/anaconda3/lib/python3.6/site-packages/conda/exceptions.py", line 1003, in __call__
return func(*args, **kwargs)
File "/home/username/anaconda3/lib/python3.6/site-packages/conda/cli/main.py", line 84, in _main
exit_code = do_call(args, p)
File "/home/username/anaconda3/lib/python3.6/site-packages/conda/cli/conda_argparse.py", line 82, in do_call
exit_code = getattr(module, func_name)(args, parser)
File "/home/username/anaconda3/lib/python3.6/site-packages/conda/cli/main_list.py", line 142, in execute
show_channel_urls=context.show_channel_urls)
File "/home/username/anaconda3/lib/python3.6/site-packages/conda/cli/main_list.py", line 80, in print_packages
show_channel_urls=show_channel_urls)
File "/home/username/anaconda3/lib/python3.6/site-packages/conda/cli/main_list.py", line 45, in list_packages
installed = sorted(PrefixData(prefix, pip_interop_enabled=True).iter_records(),
File "/home/username/anaconda3/lib/python3.6/site-packages/conda/core/prefix_data.py", line 117, in iter_records
return itervalues(self._prefix_records)
File "/home/username/anaconda3/lib/python3.6/site-packages/conda/core/prefix_data.py", line 146, in _prefix_records
return self.__prefix_records or self.load() or self.__prefix_records
File "/home/username/anaconda3/lib/python3.6/site-packages/conda/core/prefix_data.py", line 70, in load
self._load_site_packages()
File "/home/username/anaconda3/lib/python3.6/site-packages/conda/core/prefix_data.py", line 261, in _load_site_packages
python_record = read_python_record(self.prefix_path, af, python_pkg_record.version)
File "/home/username/anaconda3/lib/python3.6/site-packages/conda/gateways/disk/read.py", line 245, in read_python_record
pydist = PythonDistribution.init(prefix_path, anchor_file, python_version)
File "/home/username/anaconda3/lib/python3.6/site-packages/conda/common/pkg_formats/python.py", line 76, in init
return PythonEggLinkDistribution(prefix_path, anchor_file, python_version)
File "/home/username/anaconda3/lib/python3.6/site-packages/conda/common/pkg_formats/python.py", line 416, in __init__
anchor_full_path = get_dist_file_from_egg_link(anchor_file, prefix_path)
File "/home/username/anaconda3/lib/python3.6/site-packages/conda/common/pkg_formats/python.py", line 915, in get_dist_file_from_egg_link
assert len(egg_info_fnames) == 1, (egg_link_file, egg_info_fnames)
AssertionError: ('lib/python3.6/site-packages/vqvae.egg-link', ['pytorch_wavenet.egg-info', 'vqvae.egg-info'])
`$ /home/username/anaconda3/bin/conda list`
environment variables:
CIO_TEST=<not set>
CONDA_DEFAULT_ENV=envname
CONDA_EXE=/home/username/anaconda3/bin/conda
CONDA_PREFIX=/home/username/anaconda3/envs/envname
CONDA_PROMPT_MODIFIER=(envname)
CONDA_PYTHON_EXE=/home/username/anaconda3/bin/python
CONDA_ROOT=/home/username/anaconda3
CONDA_SHLVL=1
DEFAULTS_PATH=/usr/share/gconf/ubuntu.default.path
LD_LIBRARY_PATH=:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64
MANDATORY_PATH=/usr/share/gconf/ubuntu.mandatory.path
PATH=/home/username/anaconda3/bin:/home/username/anaconda3/envs/envname/bin:/home
/username/anaconda3/bin:/home/username/anaconda3/bin:/home/username/.cargo/bin:
/home/username/anaconda3/bin:/efs/bin:/efs/bin:/home/username/anaconda3/cond
abin:/home/username/anaconda3/bin:/efs/bin:/efs/bin:/home/username/.cargo/bi
n:/home/username/bin:/home/username/.local/bin:/usr/local/sbin:/usr/local/bi
n:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:
/home/username/.fzf/bin
PYTHONPATH=/efs/lib/python3.5/dist-packages/
REQUESTS_CA_BUNDLE=<not set>
SSL_CERT_FILE=<not set>
WINDOWPATH=2
active environment : envname
active env location : /home/username/anaconda3/envs/envname
shell level : 1
user config file : /home/username/.condarc
populated config files :
conda version : 4.6.14
conda-build version : 3.0.27
python version : 3.6.8.final.0
base environment : /home/username/anaconda3 (writable)
channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/free/linux-64
https://repo.anaconda.com/pkgs/free/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /home/username/anaconda3/pkgs
/home/username/.conda/pkgs
envs directories : /home/username/anaconda3/envs
/home/username/.conda/envs
platform : linux-64
user-agent : conda/4.6.14 requests/2.18.4 CPython/3.6.8 Linux/4.15.0-47-generic ubuntu/18.04.2 glibc/2.27
UID:GID : 1000:1000
netrc file : None
offline mode : False
An unexpected error has occurred. Conda has prepared the above report.
If submitted, this report will be used by core maintainers to improve
future releases of conda.
Would you like conda to send this report to the core maintainers?