Questions tagged [filenames]

Filenames are metadata about a file; a string used to uniquely identify a file stored on the file system of a computer.

The filename is metadata about a file; a special kind of string used to uniquely identify a file stored on the file system of a computer. Some operating systems also identify directories in the same way. Different operating systems impose different restrictions on length and allowed characters on filenames.

4148 questions
1
vote
1 answer

How to save multiple files in loop with original filenames

I'm trying to import several SAS datafiles from a folder and then save them back into the folder as R dataframes with the same original SAS dataset name. Everything works except I can't figure out how to save the file with the original file name…
Ryan
  • 59
  • 9
1
vote
1 answer

How to get file name what will be opened in Maya Callback: kBeforeOpen

I want to know filename what will be opened before opening. Maya have the callback: kBeforeOpen But when i try to read file name in callback function - i receive a name of current file but not file that will be opened. def before(*args, **kwargs): …
Massimo
  • 836
  • 3
  • 17
  • 38
1
vote
1 answer

Search and Replace Keyword with File Name across Multiple Files

I am trying to do a mass search and replace across many files where I replace a keyword in the file, lets say myKeyword, with the name of the current file. So in file1.php the phrase myKeyword would become file1; in file2.php it would become…
1
vote
1 answer

Carrierwave Uploader specify Version directory using same file name for Rails 5

I want to use the same file name but a different directory for a version of my uploaded file. upload file imageName.jpg should create uploads/drawing/2018/imageName.jpg #which is the original file uploads/thumbs/2018/imageName.jpg #a…
ESim
  • 11
  • 2
1
vote
3 answers

Ruby open file name with spaces from the shell on Windows

So, I can open files from the shell using ruby with system("start filename"). However, when the file has a space on it, it doesn't work, even though I add the escape \, or if I use shellescape. Apparently one method would be to first obtain the 8.3…
1
vote
2 answers

Does Python zipfile always use posixpath filenames regardless of operating system?

It probably won't matter for my current utility, but just for good coding practice, I'd like to know if files in a ZIP file, using the zipfile module, can be accessed using a POSIX-style pathname such as subdir/file.ext regardless of on which…
jcomeau_ictx
  • 37,688
  • 6
  • 92
  • 107
1
vote
3 answers

Multi-Variable File Naming Convention

Heyo! I am trying to change the filenames of all of the pictures in folder to a new naming schema so that a program I am using can recognize it. the current naming schema is 'cam1_###.png' where the ### is the number in the sequence. For example,…
Jacob W. Dallas
  • 383
  • 3
  • 12
1
vote
2 answers

Exclude extensions in filename filter in Java

My Controller method (which has a method to list the files, from a path mentioned in the property file, on JSP) private String[] getFileListing(String servers) throws IOException { Properties prop = new Properties(); String…
1
vote
2 answers

resolving OS vs list.files() handling of accented characters

I'm correcting some homework from students who have accented characters in their names (not my home locale), and foolishly decided to honor the actual spelling of their names in creating files with my comments (Firstname.Lastname). In general, I…
Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
1
vote
1 answer

Create new element and use filename as data within multiple XML files

Powershell newbie here. I need to write a script that will read the basename of multiple XML files and then use that value as data to populate a new element which will also be created by the running of the script. So each XML will be updated with…
M Jenks
  • 85
  • 4
1
vote
1 answer

C regex validate filename under a folder

I am new to regular expressions in C and I am trying to find if the given filename is under a folder using regex using regex.h library. This is what I have tried: #include #include #include #include int…
Mustafa Süve
  • 151
  • 2
  • 11
1
vote
1 answer

Exporting textfiles from VCorpus including original file names in R

I'm quite new to R and currently working on a project for my studies (readability vs performance of annual reports). I've literally screened hundreds of posts but could not find a proper solution. So, I'm stuck and need you're help. My goal is to tm…
vince00
  • 13
  • 3
1
vote
0 answers

Java code to append numbers to non-english character in file name

I have a list of files whose file name contains non-English characters. It is required to prefix a unique 16 digit number to the names of these files. I have a text file, say "FileMap.txt" which stores the non-English file name and its corresponding…
1
vote
1 answer

Filename is getting corrupted randomly when using os.walk()

I'm trying to get all the files within a folder using os.walk(), the code I'm using is: #Define folder and pattern to find rootPath = "./root_folder" pattern = "*MATCH*" #Look for all the files with "MATCH" on its file name Final_List = [] for…
juanman
  • 137
  • 1
  • 9
1
vote
4 answers

using os.path to write output files with variable names

I'm trying to save the results of a model estimation to a file. I have tried a number of things but it doesn't work because I'm obviously not doing it correctly. I'm not even sure os.path.join is the right command from os.path: #output the vectors…
profhoff
  • 1,017
  • 1
  • 13
  • 21