rename

TFS: pending delete+add => file rename

时光总嘲笑我的痴心妄想 提交于 2019-12-11 12:19:49
问题 How do I tell TFS that pending file delete and add is actually a rename ? For example, I deleted 201505132029594_InitialCreate.cs and tool created 201509141933543_InitialCreate.cs I'd like to tell TFS that this was a file rename+edit. Ideally, from command line, something like tf rename /someswitch 201505132029594_InitialCreate.cs 201509141933543_InitialCreate.cs Apparently, this functionality exists in the UI (see "To fix the results of an operating system rename"): https://msdn.microsoft

How read contents of txt files in different directories and rename other files according to

只谈情不闲聊 提交于 2019-12-11 10:53:58
问题 I just started with Python 3 and ran into the following problem: I downloaded a good deal of PDFs from different journals for my thesis, but they are all named after their DOI and not in the format “Author (Year) - Title”. The documents are saved in different directories, according to the journal's name and volume, e.g.: /Journal 1/ /Vol. 1/ file1.pdf file1.txt file2.pdf file2.txt filen.pdf filen.txt /Vol. 2/ file1.pdf file1.txt /Journal 2/ ... Because I have no idea how to read the contents

How to rename entries in pandas dataframe?

谁说胖子不能爱 提交于 2019-12-11 10:46:34
问题 I have a dataframe like this df= a b 54 12 54 16 18 3 3 33 I want to rename the entries starting from 0 and return something like this: df1= a b 0 1 0 2 3 4 4 5 回答1: IIUC, you can get the list of unique values in your dataframe with: In [1]: pd.Series(df.values.flatten()).unique() Out[1]: array([54, 12, 16, 18, 3, 33]) Let's make it into a series (you'll see why): In [2]: series = pd.Series(pd.Series(df.values.flatten()).unique()) In [3]: series Out[3]: 0 0 54 1 12 2 16 3 18 4 3 5 33 Now all

Can I rename files in subfolders based on.CSV file using Powershell

与世无争的帅哥 提交于 2019-12-11 10:16:29
问题 I want to rename some files based on .csv file, I succeeded to do so using the following code Import-Csv "C:\Location\rename.csv" | foreach { Rename-Item -Path $_.Oname -NewName $_.NName } but that renames only the files in the parent folder I tried to make it includes the files in the sub-folders but in vain I tried to add Get-ChildItem It gets error, probably I don't know how to combine it with the import csv the .csv file format is Oname,NName Name1,NewName1 Name2,Newname2 回答1: here's one

Batch file to rename files in multiple folders

纵然是瞬间 提交于 2019-12-11 10:11:20
问题 I have the folder and file structure as given below. I am in need of a MS DOS batch file to rename the files in multiple folders. Can anyone please help out? TIA. -Main Folder -->Sub Folder1 --- File1_EN.txt --- File2_EN.txt --> Sub Folder2 --- File3_EN.txt --- File4_EN.txt I want to rename the suffix "EN" in file names to "ENU". 回答1: @echo off for /D %%d in (*) do ( ren "%%d\File*_EN.txt" "File*_ENU.txt" ) 回答2: You can do it by this way: @Echo OFF Set "Folder=C:\Users\Administrador\Desktop

PHP image uploader rename image?

六眼飞鱼酱① 提交于 2019-12-11 09:06:16
问题 I'm trying to rename an image when uploading it to my server. Is there generally an easy way of doing this? Below is the php code I'm using. I want to rename it as a variable I'm passing through as a hidden field from a html form. //variable from hidden field on form which is from mysql database $imageName = $_POST['image_rename']; if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/jpg") || ($_FILES["file"]["type"]

Dos batch file titlecase and remove special characters

99封情书 提交于 2019-12-11 08:44:20
问题 @Echo Off SetLocal EnableDelayedExpansion Set _ScrFldr=%~dp0 PushD %_ScrFldr% :: You can add other extensions to do multiple file types For /F "Delims=" %%A In ('Dir /A-D /B *.txt') Do ( :: The space after the = is needed so we can Proper Case the first word Set _FileName= %%A :: Remove (, replace ( with _, replace - with _-_ , :: replace _ with space, and a first pass at removing multiple spaces For %%I In ("%%~xA=" ".= " ")=" "(=_" "-=_-_" "_= " " = " **"!="**) Do Call Set "_FileName=%%

php: Warning: rename The filename, directory name, or volume label syntax is incorrect. (code: 123)

∥☆過路亽.° 提交于 2019-12-11 08:29:42
问题 Since I am trying to copy my file I am getting this error, I am using windows 8.1 Warning: rename(../user/will/video/javascript-toggle-buttons-MonMar09122015-7491.mp4,../user/will/video/video-SunMar-15-18:03-2015-shared.mp4): The filename, directory name, or volume label syntax is incorrect. (code: 123) in E:\xampp\htdocs\social_media\root\php_parsers\status_system.php on line 353 this is I am trying to do, if (file_exists("../user/$author/$folder/$file")) { if (!file_exists("../user/$account

C# - Ways to rename a directory [duplicate]

痴心易碎 提交于 2019-12-11 07:24:21
问题 This question already has answers here : Can't rename directory in C# but manually (3 answers) Closed 6 years ago . I'm using Directory.Move(oldDir, newDir) to rename a directory. Every now and then I get an IOException saying "Access to the path 'oldDir' is denied". However if I right click the directory in the explorer I can rename it without any issues. So my question is: Are there any other ways to rename a directory without using Directory.Move ? I thought of using the command shell (

Renaming files with inode number [UNIX]

余生长醉 提交于 2019-12-11 07:04:03
问题 I'm simply trying to rename a file by attaching an underscore and the inode number of said file before I move it to a directory. The description is: To avoid name conflicts in the recycle bin, change the file name to the original name followed by an underscore, followed by the inode for the file. For example, if a file named "f1" with inode 1234 were removed, the file would be named f1_1234 in the recycle bin. Any ideas? 回答1: It is easy if parallel is available : ls f* | parallel 'mv {}