file-rename

Get the Perl rename utility instead of the built-in rename

假如想象 提交于 2019-12-17 05:02:20
问题 Many sites (including various SO articles) talk about using "rename" using Perl expressions to rename files. This would be perfect, but apparently this is not the rename utility I have, and none of these articles seem to comprehend that there are multiple versions of "rename" and I can't seem to find where to get version that accepts Perl expressions. How can I get my hands on the more powerful rename utility mentioned here, here, and here? I'm running Fedora 20. My current rename command is

Windows 7 64 Bit/Save mode: Rename msi.dll not possible [closed]

和自甴很熟 提交于 2019-12-13 09:46:56
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . Due to problems with the windows installer 5 I must rename msi.dll for reinstallation. That's not possible in save mode/as administrator (access denied). Of course the service is stopped. Any hints? Edit: My problem is that I can't install msi files anymore. Everytime after some dialogs I get an error message

Windows bat file to rename multiple files with custom names

佐手、 提交于 2019-12-13 09:12:19
问题 I have multiple folders with multiple files in each of them. The file names are as following: static-string -1.wav static-string -2.wav .... static-string -10.wav ... static-string -99.wav static-string -100.wav ... and so on. The static string remains same but the number before .wav changes from 1 - 999. Now the problem is if I want to play this on any media player or want to join all the files, windows will sort like 1,10,100,2,20,200 not 1,2,3,4,5,6,7,8,9,10 which messes up the playback.

Automatically rename fasta files with the ID of the first sequence in each file

别来无恙 提交于 2019-12-13 04:22:26
问题 I have multiple fasta files with single sequence in the same directory. I want to rename each fasta file with the header of the single sequence present in the fasta file. When i run my code , i obtain "Substitution pattern not terminated at (user-supplied code)" my code: #!/bin/bash for i in /home/maryem/files/; do if [ ! -f $i ]; then echo "skipping $i"; else newname=`head -1 $i | sed 's/^\s*\([a-zA-Z0-9]\+\).*$/\1/'`; [ -n "$newname" ] ; mv -i $i $newname.fasta || echo "error at: $i"; fi;

Batch script to remove parts of a filename

自闭症网瘾萝莉.ら 提交于 2019-12-13 01:25:52
问题 Help please! I need to remove time stamp and file number off of the filename using a windows batch script. Thank you! Thank you in advance! OLD Filename= CAM168-NOTSET.2013.10.01.18.45.45.882.jpg NEW Filename= CAM168-NOTSET.jpg 回答1: @ECHO OFF SETLOCAL SET "fname=CAM168-NOTSET.2013.10.01.18.45.45.882.jpg" FOR %%i IN ("%fname%") DO FOR /f "delims=." %%j IN ("%%i") DO ECHO REN "%%~i" "%%~j%%~xi" GOTO :EOF New name merely ECHO ed. 回答2: If by "remove time stamp and file number" , you mean remove

renaming classes in iOS

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 17:10:44
问题 I am working on Xcode 4.3.2 i wanted to rename my classes so i used refactor>rename , but after that i changed my mind and decided to go back to the older name. But when i do the same thing i've done before again, a warning dialog appears saying: yourclass.h is not part of the build phase of any targets in this workspace and so can't be refactored. add the file to the build phase of a target in this workspace, or make a selection in another file. what's the build phase? how can i solve this

PowerShell - Add grandparent folder name to file name

半世苍凉 提交于 2019-12-12 16:14:33
问题 I'm still pretty new at PS Scripting, so most of what I do is hacked together from examples. What I'm trying to do right now is search all the folders in a directory for PDFs and then rename them, adding the grandparent folder name to the file name. For example: c:\export\123\notes\abc.pdf would be renamed to c:\export\123\notes\123_abc.pdf The rest of the script, which works fine, uses GhostScript to convert them to TIFs and moves them to another server. The problem is that that all the PDFs

Python program to rename file names while overwriting if there already is that file

ぃ、小莉子 提交于 2019-12-12 09:33:16
问题 As the title says, I wanted a python program that changes the file name, but I wanted to overwrite if there already is a file with that destination name. import os, sys original = sys.argv[1] output = sys.argv[2] os.rename(original, output) But my code just shows me this error when there already is file with that destination name. os.rename<original, output> WindowsError: [Error 183] Cannot create a file when that file already exists What fix should I make? 回答1: On Windows os.rename won't

Win32 API for rename a file in C

无人久伴 提交于 2019-12-12 08:47:56
问题 If the source directory and the target directory, MoveFile would actually make a copy of the source file into the target file, which means that I will end up seeing two files. Is that the best way that rename can be achieved? 回答1: The MoveFile function is indeed what you want. From the documentation: The MoveFile function will move (rename) either a file or a directory (including its children) either in the same directory or across directories. If the source and destination locations are both

file renaming using python

ぐ巨炮叔叔 提交于 2019-12-12 06:04:55
问题 I am trying to rename a file in which it is auto-generated by some local modules but I was wondering if using os.listdir is the only way for me to filter/ narrow down this file. This file will always be generated before it is removed and the code will generate the next one (still in the same directory) based on the next item in list. Basically, whenever this file is generated, it comes in the following file path: /user_data/.tmp/tempLibFiles/2015_03_16_192212_182096.con I had only wanted to