rename

How to update in hundreds m scripts a variable definition?

末鹿安然 提交于 2019-12-13 05:12:09
问题 We have in University hundreds of m scripts and we want to change/update some definitions of the variables. We want to change all the ufix(*), sfix(*) to fixdt(*,*) . So I imagine that I could make an m-script that read the m-files and changes all the definitions. I think the difficult part of the script is to find for example a ufix(8)-unsigned 8bit and to change into fixdt(0,8) . Do you know a function in Matlab which makes this automatic? 来源: https://stackoverflow.com/questions/31510356

Copy and Rename multple file types using batch file

六月ゝ 毕业季﹏ 提交于 2019-12-13 04:46:51
问题 I want to copy and rename multiple files form Directory A to B. I am looking to add a trimesatmp to each file name copied. This code succesfully copys form one dir to another without overwriting any doceuments with same filename. echo N|xcopy /-Y "C:\Users\haematology\Desktop\FolderA" "C:\Users\haematology\Desktop\FolderB" My timestamp: for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a" set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set

Renaming a batch file and keeping part of the filename

流过昼夜 提交于 2019-12-13 04:46:43
问题 I've seen plenty of posts on similar requests but I can't quite find one that suits what I am trying to do. It is fairly simple but I cannot seem to get it. ren FILE??.txt FILE%Year%%Month%%Day%??.txt copy FILE%Year%%Month%%Day%??.txt C:\Users\me\Desktop\Batch\renamed\achod%Year%%Month%%Day%??.txt I cannot get the script to keep the '??' which represents random characters the first file may have. Any help is appreciated. 回答1: You won't be able to rename files directly using a wildcard

Unable to install Linux's rename to Mac

孤者浪人 提交于 2019-12-13 04:34:56
问题 I read the tutorial which advises me to run at util-linux package ./configure I get configuring util-linux-2.12q You don't have <scsi/scsi.h> You don't have <linux/blkpg.h> You don't have <linux/kd.h> You have <locale.h>You have <langinfo.h> You have <sys/user.h> You have <uuid/uuid.h> You have <rpcsvc/nfs_prot.h> You don't have <asm/types.h> You don't have <linux/raw.h> You have <stdint.h> You don't have <sys/io.h> You have inet_aton() You have fsync() You have getdomainname() You have

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;

How to rename all columns in a dataframe to include the name of the data for all dataframes in a list?

早过忘川 提交于 2019-12-13 01:59:08
问题 I have a list of data frames listofdfs . To rename the columns of one of the dataframes singledf in the list, the following code works: colnames(listofdfs[["singledf"]]) <- paste(colnames(listofdfs[["singledf"]]), "singledf") Aim To rename all columns for all data frames in a list of dataframes, listofdfs , to include the name of the dataframe in all of the respective column names. Attempt 1 for (i in listofdfs){ colnames(listofdfs[i]) <- paste(colnames(listofdfs[i]), i) } This error occurs

Recursive batch rename

六眼飞鱼酱① 提交于 2019-12-13 00:41:10
问题 I have several folders with some files that I would like to rename from Foo'Bar - Title to Title I'm using OS X 10.7. I've looked at other solutions, but none that address recursion very well. Any suggestions? 回答1: Try this: ls -1 * | while read f ; do mv "$f" "`echo $f | sed 's/^.* - //'`" ; done I recommend you to add a echo before mv before running it to make sure the commands look ok. And as abarnert noted in the comments this command will only work for one directory at a time. Detailed

Rename Windows folders in C++

安稳与你 提交于 2019-12-13 00:14:59
问题 I was wondering if there was a simple way of programming in C++ the renaming of a Windows folder. The program I would like to make would be something like this: rename folder "Something A" to "Something TEMP" rename folder "Something B" to "Something A" rename folder "Something TEMP" to "Something B" 回答1: You need to use MoveFile(). I know it sounds funny but it works for directories too. :) 回答2: For the operation of renaming once, see MoveFile or MoveFileEx on MSDN: BOOL WINAPI MoveFile( _In

Renaming a directory locks renamed dir the second time I want to rename

柔情痞子 提交于 2019-12-12 19:52:10
问题 I'm having problems with renaming a directory multiple times, it seems to lock the file. // e comes from a objectListView item DirectoryInfo di = (DirectoryInfo)e.RowObject; DirectoryInfo parent = Directory.GetParent(di.FullName); String newPath = Path.Combine(parent.FullName, e.NewValue.ToString()); // rename to some temp name, to help change lower and uppercast names di.MoveTo(newPath + "__renameTemp__"); di.MoveTo(newPath); // Trying to cleanup to prevent directory locking, doesn't work...

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