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 11 years ago.
Improve this question
Is suffix ( for example .jpg or ,txt ) a part of file name ?
for example I have this file : "picture.jpg", what is file name in this file ?
thanks
Yes,these suffixes are the part of the file name,as they are the formats
in which the files are saved on to your computer,From here
Filename extensions can be considered a type of metadata. They are
commonly used to imply information about the way data might be stored
in the file. The exact definition, giving the criteria for deciding
what part of the file name is its extension, belongs to the rules of
the specific filesystem used; usually the extension is the substring
which follows the last occurrence, if any, of the dot character
(example: txt is the extension of the filename readme.txt, and html
the extension of mysite.index.html).
Read about it here: http://en.wikipedia.org/wiki/Filename_extension
A filename extension is a suffix to the name of a computer file applied to indicate the encoding convention (file format) of its contents.
Related
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
I have a .exe file (let's say it's name is XXX.exe) whose job is to clean a text file with all lines starting with %. Usually I call the .exe file in CMD as:XXX.exe clean_text.dat and it does the job.
However I want to create a batch file where the text file's name will be user input and rest everything will be done automatically. I have written a script as:
#echo off
set /p file= Enter filename:
XXX.exe file
After giving the filename (with full path), CMD flashes error saying it can't access to the input file.
I believe the last line is not correctly writtten. Can anyone provide the solution?
Use %file% in the last line. You want the contents of variable file and not the name of the variable to be used as parameter for program XXX.exe.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I have a batch of PDF files in a folder and I am trying to rename them.
Example:
File1_20170501_data.pdf
File2_20170401_statistics.pdf
Sale2_20170404_Misc.pdf
I only want to keep the first six characters of each file name (the five characters left to underscore and the underscore) and replace everything behind with sample data.
The final file names should be:
File1_sample data.pdf
File2_sample data.pdf
Sale2_sample data.pdf
Anyone can advice which command line to use for this file renaming task?
Given your provided information at the time of this answer, one simple command should do what you need:
Ren "C:\path to\a folder\?????_*.pdf" "?????_sample data.pdf"
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am using Audacity's Chains scripting function to batch-convert and edit many large, uncompressed .WAV files at once to a much smaller .OGG format. I end up with a folder structure like the following:
f:/sound-recordings:
-- rec1.wav
-- rec2.wav
-- rec3.wav
-- rec4.wav
-- rec5.wav
f:/sound-recordings/cleaned:
-- rec1.ogg
-- rec2.ogg
-- rec3.ogg
Some of the source .WAV files are corrupted (note rec4.wav and rec5.wav in above example), and Audacity will not convert them (at least through the chains function). This creates a problem, as it can become very tedious to compare the two folders, and delete only the .WAV files which were successfully converted to .OGG.
In the example above, "rec1.wav", "rec2.wav", and "rec3.wav" should be deleted, while "rec4.wav" and "rec5.wav" are untouched, since they weren't converted.
I need a script (batch or python preferred) to delete any .WAV files from the main folder, that have identically named .OGG files located in the "cleaned" folder, leaving other .WAV files untouched.
#echo off
for %%I in (f:\sound-recordings\*.wav) do (
if exist f:\sound-recordings\cleaned\%%~nI.ogg del %%I
)
You can create a list of the elements in the clean directory, using split to strip off the extension and then iterator through the dirty directory checking if it is in clean.
Basic python pseudo-code would look like:
clean = [filename.split('.')[0] for filename in clean_directory]
delete = [filename for filename in dirty_directory if filename.split('.')[0] in clean]
for filename in delete:
os.remove(filename)
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I want to search and replace string of the format IND A***B***C*** (where * in a number between0 to 9) in a file with some known string like IND A000B103C123
there are many files in which string is present.And I have to update the same string is all files eg."IND A110B123C112" .here 'IND' and 'A' 'B' 'C' is always same in both old and new version string
I want to writ a script (batch file) so that when run the batch file and give the new string as input, it will replace the old string with the new one
You may do that in a very simple way using my FindRepl.bat program:
< theFile.txt FindRepl "A\d\d\dB\d\d\dC\d\d\d" "A110B123C112"
In previous regular expression the \d specify "any digit". FindRepl.bat is an hybrid Batch-JScript program that performs this type of find-replacements tasks (and many more) in a very efficient way. The JScript language comes pre-installed in any Windows version from XP on. You may download FindRepl.bat program from this site and place it in the same folder of your Batch solution or, better yet, in a folder of PATH variable, so you may use FindRepl in any other similar problem.
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 10 years ago.
Improve this question
I have a java class file that is causing problems because of the length of the name:
GroundTransportationProductType$GroundTransportationOptions$GroundTransportationProductOption$GroundTransportationOptionProviderLinks$ProviderLinks.class
I have managed to get the file on the unix box (Solaris) by under a shortend file name.
my.class
How can I rename my.class to the correct class name above?
Using mv and cp normally (ie not doing something for the dollar signs) does not work.
I have googled and searched extensively but cannot find anything on how to create a file with a dollar name in it on unix.
Thanks,
Kenny
$ has a special meaning in shells, so you need to escape it somehow. The best option would be to use single quotes around your filenames. A \ in front of the '$' sign would also work.
mv my.class 'Long$File$Name.class'
or
mv my.class Long\$File\$Name.class