FAQ Database Discussion Community

Cross check files in two folders

vbscript,match,filenames
I have two folders: Master folder & New folder. Files in two folders share the same file name. I need to cross check the files between these two folders. If Master folder does not have the file, I import it from New folder. If Master folder does have the file,...

Giving a string variable as a filename in matlab

string,matlab,filenames
I am using the below mentioned code to get the file names of images according to their id's from images_1 text file as strings and use them to read the images from their directory image_count=1; for image_count=1:6 file=fopen('D:\Academics\New folder\CUB_200_2011\images_1.txt','r'); C = textscan(file, '%s'); original_image=imread('D:\Academics\New folder\CUB_200_2011\images\%s','C{1}{2*(image_count)}'); imshow(original_image) end I am able...

Java - Getting file name without extension from a folder

java,filenames
I'm using this code to get the absolute path of files inside a folder public void addFiles(String fileFolder){ ArrayList<String> files = new ArrayList<String>(); fileOp.getFiles(fileFolder, files); } But I want to get only the file name of the files (without extension). How can I do this?...

How to get filename and location of file that starts a visual basic application?

vb.net,filenames,parent
Am on Windows 8 I have a visual basic 2010 express application that plays mp3 files. It has a button which opens an openfiledialog box to select the mp3 you want to play. However I have also set my vb app to be the default opener of mp3 files. When...

Read filename with * shell bash

linux,bash,shell,variables,filenames
I'am new in Linux and I want to write a bash script that can read in a file name of a directory that starts with LED + some numbers.(Ex.: LED5.5.002) In that directory there is only one file that will starts with LED. The problem is that this file will...

AppleSctipt Finding File with partial filename

get,applescript,filenames
I am an applescript noob and i need help getting a certain log file that has a long string of numbers in its title. The number changes and the filename before the number string is unique to the folder it is in. Is there some way i can use the...

How do I escape spaces in a path with Applescript?

path,escaping,applescript,filenames,space
I've written a script so I can quickly get a link to files and folders on my server. The problem is that the string I get does not escape spaces. Can someone tell me how to escape the spaces for '%20' ? tell application "Finder" set sel to (the POSIX...

Saving multiple files with same name

c#,wpf,unique,filenames
I'm working on a C# WPF application that does some data processing and outputs files in .csv format. What I am trying to achieve is that every time my program runs, it produces a test.csv output file, however when I run again with new data.. the new resultant file overwrites...

mysqldump with date and time in backup file name on windows

windows,cmd,filenames,mysqldump
I am unix man, and I really don't like work on windows. I am asking You for help. I am trying to make regular backups of mysql database in microsoft windows cmd. Here is my current script for that: C:\xampp\mysql\mysqldump.exe -hlocalhost -uroot -ppass stp > V:\backup_3.2.2.6__%date:/=%.sql I would like to...

Automating filename generation from url text

python,filenames,python-requests
I am parsing some content from the web and then saving it to a file. So far I manually create the filename. Here's my code: import requests url = "http://rads.stackoverflow.com/amzn/click/1593271840" html = requests.get(url).text.encode('utf-8') with open("html_output_test.html", "wb") as file: file.write(html) How could I automate the process of creating and saving the...

Why the names of some css, js files have random numbers in them?

html,web,filenames
Some websites seem to have file names such as 'assets/app-02b4523sev8fsd56e.js'. I have noticed that these numbers do not change though, so I thought it has something to do with security but I am not sure. Is there any reason behind this?

How to capture a photo and immediately put it into an existing pdf?

android,filenames,image-capture
I couldn't find the solution for my issue. My MainActivity creates a pdf file, the user adds some text via EditText and closes it, no problem with that. Then I have a secondary activity that is calling the MediaStore.ACTION_IMAGE_CAPTURE to take pictures. Once a picture is taken, I'd like to...

How do I get the name of Postscript file object?

filenames,postscript
Using Postscript, I want to retrieve the name of the file being executed. I know that I can get the file object using 'currentfile', but how do I get its name? I want to include the name in the document. Thanks....

Read applications in Folder in Java

java,osx,filenames
I saw in another question how to read files in a folder and in the answers I found some code and I modified the path and nothing else public static void main(String[] args) { File folder = new File("/Applications/"); File[] listOfFiles = folder.listFiles(); for (File file : listOfFiles) { if...

Python 3 not aware of Windows filename encodings?

windows,python-3.x,encoding,path,filenames
The following code works well in Win7 until it crashes in the last print(f). It does it when it finds some "exotic" characters in the filenames, as the french "oe" as in œuvre and the C in Karel Čapek. The program crashes with an Encoding error, saying the character x...

Find digits in file names and cross reference them with others

c++,regex,string,filenames
First, I will quickly describe my motivation for this and the actual problem: I deal with large batches of files constantly and more specifically, I find myself having to rename them according to the following rule: They may all contain words and digits, but only one set of digits is...

Remove leading and tailing whitespaces from filename

linux,bash,shell,unix,filenames
I need a little help with a bash command in Ubuntu 14.04. I have a folder with many subfolders and some of the folder- and filenames have leading or tailing whitespaces. I like to rename these folders and files, but with the same filename, just without the whitespace an the...

Log4net rolling filenames [duplicate]

c#,log4net,filenames
This question already has an answer here: log4net rolling file appender file name format when maximumFileSize reached 1 answer I'm using log4net in a C# application <log4net> <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender"> <file value="..\logs\Program.log.xml" /> <appendToFile value="true" /> <rollingStyle value="Size" /> <maxSizeRollBackups value="10" /> <maximumFileSize value="10000KB" /> <staticLogFileName value="true" /> <layout...

Filename from string(path) without file exist

c#,string,filenames
I am trying to get a file name out of a string, but it is possible the file does not exist (yet) when trying to get the file name. So as far as i know, i can not use the Path.GetFileName Method, or can i somehow still use this method...

Allow dots in filenames while searching for extension using pathinfo

php,filenames,glob

Convert list of paths to list of filenames

windows,string,batch-file,filenames
Background I find myself often copying file paths to the clipboard, which is somewhat cumbersome to do from Windows Explorer. So I wrote a little .bat file to put into the %APPDATA%\Microsoft\Windows\SendTo\ folder utilising the CLIP executable to copy a list of the selected file paths to the clipboard. This...

How to Combine Two paths?

c#,xml,path,filenames
I have an XmlTextReader to read series of XML files to load some information in to my program. However, in some XML files I have the file name of an image and I want to load that image. But the problem is the XML file does not have the full...

Bash filename autocompletion after switch/parameter

bash,autocomplete,filenames
I tried this other questions's accepted answer but it doesn't work for me. So please don't vote this as duplicate. My script is named "tracker" and it accepts the following switches: --dummy --audit_sessiones --user_count --detailed_user_count --parfile The --parfile switcj should be followed by a filename. I have this autocompletion script:...

Change the file name Alfresco

I need to change the name of the file attached to the workflow and move to another location during the execution. The file name is generated based on the information entered in the form of process (Registration Number field and Sender). How can this be implemented? Thanks! For example: BX-2/Nick_Berry.xls...

pathnames in Common Lisp, filenames with wildcards in them

common-lisp,filenames,wildcard,clisp,pathname
The characters * and ? are used as wildcards in pathnames. How does one refer to a filename that has ? as one of its actual characters? For example: [18]> (wild-pathname-p #p"foo") NIL [19]> (wild-pathname-p #p"foo?") T So referring to the filename "foo?" cannot be done this way. I tried...

python compare and replace strings in txt file with filenames

python,list,replace,compare,filenames
I have a file data.txt and a sounds folder with mp3 music files. data.txt contains a list of filenames.mp3 (in random order) from the sounds folder and from other folders. I've converted the mp3 files in the sounds folder to wav, and I want to replace the filenames.mp3 in the...

php,filenames,sftp,phpseclib
I am trying to download a file from a SFTP server. I have managed to connect to it and download the files. The problem is that the file in the server will be updated daily and part of the filename is the exact time when it is generated which is...

Powershell file and directory names as strings, sans decorations

string,powershell,filenames

Batch-Script: Replace every “@” in file name with “_” in network drive including subfolders

batch-file,replace,folder,filenames
My Problem is this: I want to replace every Special character such as "@" in file names. Example: old file: [email protected] new file: test_home.txt This should be done in a special chosen Folder including subfolders. The user should easily Change the Location (Folder). Thx guys Alright Well, I will give...

writing to variable filename

c++,filenames,fstream,ofstream
I want to write to different files with names give by variable r. Following is what I wrote. The proble here is, it is just opening the first file 'r=0.5.txt' and writing on it the data for r=0.5. However, it does not open and write on other files with r=0.6,...

Python: how to obtain only first filename in the directory

python,path,filenames
I have path for the various directories. Now I want to look into header info of first file in each directory. Eg: path = "Users/SDB/case_23/scan_1" Now in sub directory scan_1 I want to check some header information. For this purpose how can I get complete path and name of first...

Getting NoneType Error When Using Regex to Change Filenames in Python

python,regex,filenames
I'm trying to use change a bunch of filenames using regex groups but can't seem to get it to work (despite writing what regexr.com tells me should be a valid regex statement). The 93,000 files I currently have all look something like this: Mr. McCONNELL.2012-07-31.2014sep19_at_182325.txt Mrs. HAGAN.2012-12-06.2014sep19_at_182321.txt Ms. MURRAY.2012-06-18.2014sep19_at_182246.txt The...

Why PHP cant find long filenames?

php,filenames
inside a Folder i have a file, named 111-aaaaaa aa aaaa-,._aaaaaaa; aaaaaaaa, aa aaaaaaaaaa, aaaaaaaaa aaaaaaaa. 03.01.10. 38.38 aaaaa.txt when i browse that directory with PHP (or trying to read that file): var_dump(glob('MyFolder/*'));exit; it cant find that file. what's problem?? (if i shorten the filename, then it becomes findable..I am...

How to read files in C# in a directory whose names contain a specific word? [closed]

c#,directory,filenames
I have a directory on my C: drive called practice. I have txt files there with these names: CityUpdated, TownUpdated, MetroNotUpdated, SuburbNotUpdated. I want to write some C# code that reads the text files whose names contain the word "Updated". But I can't figure out how to do this using...