filenames

Drupal 7: naming node with Theme Developer

血红的双手。 提交于 2019-12-13 19:46:07
问题 I'm working on a Drupal 7 website. I need a custom node for a page, and I used Theme Developer module to find the candidate name for the node which I attached screenshot below. But it doesn't take action when I name as node__28.tpl.php What am I missing?! Thanks a lot! appreciate helps! 回答1: It should work with node--##.tpl.php . And don't forget to clear cache. 来源: https://stackoverflow.com/questions/5178751/drupal-7-naming-node-with-theme-developer

powershell list of unique parts of filename

偶尔善良 提交于 2019-12-13 16:49:45
问题 I have multiple machines uploading files to one FTP directory. The first part of the filename is the machine, the rest is a timestamp, e.g. AAAAA_20130312_125113. Now I want to get a sorted list of all Unique machines that have uploaded to this directory. I managed to write the lost of all filenames.substring(0,5) to the host but I still don't have the unique machine names. $files=Get-ChildItem $strMOVETO -Name -Include TAS*.csv -Recurse ForEach ($i in $files) { Write-Host $i.Substring(0,5) }

For loop with file names in R

徘徊边缘 提交于 2019-12-13 14:29:21
问题 I have a list of files like: nE_pT_sbj01_e2_2.csv , nE_pT_sbj02_e2_2.csv , nE_pT_sbj04_e2_2.csv , nE_pT_sbj05_e2_2.csv , nE_pT_sbj09_e2_2.csv , nE_pT_sbj10_e2_2.csv As you can see, the name of the files is the same with the exception of 'sbj' (the number of the subject) which is not consecutive. I need to run a for loop, but I would like to retain the original number of the subject. How to do this? I assume I need to replace length(file) with something that keeps the original number of the

Batch file to Move files based on part of filename, to folder based on part of folder name

柔情痞子 提交于 2019-12-13 09:43:14
问题 Found a pyhton solution here, but I need a batch file-based solution. Have many files: SSP4325_blah-blah-blah.xml JKP7645_blah.xml YTG6457-blah-blah.xml And folder names that contain a piece of the file name: RefID - SSP4325, JKP7645, GHT1278, YRR0023 RefID - YTG6457 I'm looking for a batch solution which would read a portion of the file name at the front (before either the first dash or underscore) and then move that file into the folder where the front of the filename exists as part of the

Get the file name from a full or relative path knowing that this one is not a parameter of the batch

耗尽温柔 提交于 2019-12-13 08:27:50
问题 When a file, along with relative path or full path..., is given as a parameter of a batch, I know how to expand %1 to get the file name %~n1 It's quite easy! Nevertheless, I want to get the name of file from its relative/full path which is right handled inside the batch. Please look at my code. I'd like to expand %%x (which is a relative path in my case) to take account only its file name. Please do you have any idea? Thanks @echo off SETLOCAL EnableDelayedExpansion set currDir=%CD% for /f

matching and reformatting poorly typed filenames

喜夏-厌秋 提交于 2019-12-13 08:14:01
问题 I have a large number of filenames that have been poorly written which I would like to clean up. The idea is to reformat the names so that they are more sensible. Here are some examples: 01harpharm_3.1.aiff 1 01harpmute_2.6.aiff 1 01harpmute_2.6.aiff 2 01harpmute_2.6.aiff 3 01harpmute_2.6.aiff 4 If we look at the last example, the goal would be to rewrite 01harpmute_2.6.aiff 4 as 01harpmute_2.6.4.aiff . I would like to use bash for this, either via a script (for loop), find, rename, or a

Set a Variable from a filename to read all the files from a directory

馋奶兔 提交于 2019-12-13 07:44:37
问题 I want to set a new variable with filename in SAS. I have a bunch of txt files in a folder, I have a macro that reads all my text files, along with this I want to create another variable where it reads all the filenames. what I am trying to do is very similar to the question asked here before SAS set a variable from a filename and the solution offered here works for me, except it only reads only one of my file. How can I use this in a macro or even by its own to input all my filenames. reg1

bash loop over file mask

假装没事ソ 提交于 2019-12-13 07:14:36
问题 What's the proper way to do a for loop over a file mask? E.g. if the mask doesn't expand to any file, then the loop should not run; else, it should run over all the files that it expands to. The problem with naive approach is that if the * doesn't expand to anything, then the whole loop will run once as if the * part is an actual part of a filename (of a file that doesn't actually exist). 回答1: One way to do this is: for f in abc*; do if [[ -f "$f" ]]; then # Do something with "$f" fi; done

Write to a file + filename is a string that needs to be manipulated slightly

僤鯓⒐⒋嵵緔 提交于 2019-12-13 06:27:22
问题 This is a string I want to manipulate and be part of a filename I want to write to: $ echo "$val1" "$29.95 Carryover Plan 1GB" This is what I want the file name to be, (spaces repalaced with underscore and double quotes removed) and NAME_ added at start and _NAME added at end. $ echo "NAME_"$val1"_NAME" | sed s/" "/_/g | sed s/'"'/''/g NAME_$29.95_Carryover_Plan_1GB_NAME And this is me trying to write test data to the file in question $ a="NAME_"$val1"_NAME" | sed s/" "/_/g | sed s/'"'/''/g &

How to extract name of file?

狂风中的少年 提交于 2019-12-13 05:45:22
问题 In a dir i have some files which looks something like; org.coy. application _0.1-2_arm.deb com.cpo. app2 _1.2.1_arm.deb sg.team.works. app3a _1.33_arm.deb com.share. name4 .deb com.sha-re. app5 .deb com.sha.re. anything .deb I only require the bolded names. here's what i have so far; for file in *.deb; do name=$(echo "$file" | sed 's/^.*\.\([^.][^.]*\)\.deb$/\1/') echo $name done 回答1: for i in *.deb do name=${i%.deb} #<-- remove extension (.deb) name=${name%%_*} #<-- remove version (_x.y.z