FAQ Database Discussion Community

std::cin working for small number of lines, but not larger ones

c++,list,import,filenames,cin
I'm writing a part of a program that takes a list of filenames provided by the user and stores them in a vector. So far, testing with small numbers of filenames (I've done up to 11) works fine and the program continues, but trying to import 70 or more filenames...

How to get file name of directory and written in button or label?

vb.net,directory,filenames
How can I find the file name of a directory? I would like to customize a label or button. Example: LigaBBVA.jpg then on the button or the label, LigaBBVA will also written without the extension....

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...

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...

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,...

space containing items in bash for-loop

bash,for-loop,whitespace,filenames,filepath

Copy certain files from one folder to another using python

python,file,csv,filenames
I am trying to copy only certain files from one folder to another. The filenames are in a attribute table of a shapefile. I am successful upto writing the filenames into a .csv file and list the column containing the list of the filenames to be transferred. I am stuck...

Exception handling, only accept specific file inputs

python,input,types,exception-handling,filenames
This is a bit above my pay grade, so I thought I would ask on here. My simple Python code prompts the user to enter the name of a file. However, it must be a specific type of file, or else I would like to throw an error. In this...

Beginner Python: save output file as argv input filename

python,filenames,argv
I want to save my generated plot with the same name as the input file. The input is through the command line, so I'm not really sure how to do it. #!/usr/bin/python import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from numpy import arange,array,ones#,random,linalg from pylab import plot,show from scipy import...

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...

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...

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?

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?...

Copy file1 name inplace of file2 and add extra to it, but not copy file1 extention

java,file,copy,filenames,rename
How can i change the name of a file to match the original file and have extra txt in it, please see example below Original dataFile.txt thisNameNeedsToMatchDataFile.txt (but also have ".Step2" added in before the .txt) Desired output dataFile.txt dataFile.Step2.txt Any help would be appropriated thank you in advanced....

VBA Save As Current Filename +01

vba,excel-vba,iteration,filenames,save-as
I'm looking to write a macro to save my current version filename +1 instance of the version. For each new day the version would reset to v01. Ex. Current = DailySheet_20150221v01; Save As = DailySheet_20150221v02; Next Day = DailySheet_20150222v01 While increasing the version number, I am hoping the version won't...

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...

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...

Calling a variable in Matlab without using the full name? [closed]

matlab,variables,filenames
I am creating a script to be universal in opening pre-made Data files that hold the same basic information, but the original files are not consistent in how they are named. An example, the same variable has 3 different variants in the different files: Data01.SubData Data01.SubData_01 Data01.SubData01 Is there a...

PHP - Find File in Directory By File Name [closed]

php,select,directory,filenames
I have a directory full of filenames that contain unix timestamps. file_1434320602.data file_1434320352.data file_1434320112.data file_1434320032.data How would I get about loading them up in PHP so that I can select the one which I needed?...

In PHP, find an existing file using a regex pattern for the file name

php,regex,filenames
I'm aware of the glob function. However, I am needing to match a regex pattern. Say I have the following directory of files: /assets |- logo-abd6d458.png |- logo-big-bd7543cd.png |- another-ab87dbf0.css +- something-784b52ac.png I need a PHP function that should return a filename of an existing file in this directory when...

Randomly select image an from directory using php and use its filename for a mysql query

php,mysql,random,filenames
I have a directory of images which are all named *.jpg, where * is the ID of each record in a MySQL table. e.g. 1394.jpg What I'd like to be able to do is pull 5 random images from that directory using PHP and for each image, then query the...

Simple ZSH function and files with spaces in their name

whitespace,filenames,zsh,expansion
I have put the following function into my ~/.zshrc file: function note() { vim $HOME/Dropbox/$1.md } When I call it with note "20150209-132501-Recx-new note today.md" for example it creates a new file but with the file name "20150209-132501-Recx-new". I realise this is a simple question but how do I get...

Powershell file and directory names as strings, sans decorations

string,powershell,filenames

VB6 get filename from path

csv,path,vb6,filenames
In my VB6 code I have the statement Open CommonDialog.FileName For Input As #intFileNum The problem is that CommonDialog.FileName returns an entire path and VB6 Open command needs just a filename. For example if the path is C:\temp\file_name.csv then CommonDialog.FileName will return C:\temp\file_name.csv but this Open statement in VB6 will...

BASH find file names but skip a list of file names

bash,printf,sh,filenames
I'm trying to set up a process in BASH from the "find" output. However I also have a list of file names that should not be process but they are in the same directory. I can't differentiate the files by file type. An example is the following: m001.png m002.jpg m003.tif...

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....

Android replaces certain characters in the filename with ASCII hex value

android,filenames
I'm creating files in my app with '{' and '}' in the filename (e.g. {foo}.xml). However, the special characters are being replaced with the ASCII hex values instead (i.e. {foo}.xml is created as %7Bfoo%7D.xml). Any thoughts on how to get around this and have it actually create '{foo}.xml' ?

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...

VBA Excel: Make header depend on filename

I've created a Macro that takes care of a document's lay-out, print properties, etc. Now I'd like to add a way to make the header depend on the filename. If there is a W to be found in the filename, the header should read "Weekly report", in any other case...

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...

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...

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...

Using basename to name output file in java

java,find,xslt-1.0,filenames,zsh
I have a recursive structure of directories containing some foo files that I want to convert to bar files using a XSLT 1.0 stylesheet. I have: dir |-- subdir | |-- file1.foo | |-- file2.foo | |-- file3.foo And I want to obtain: dir |-- subdir | |-- file1.foo |...

Python, pygame - Loading image filename from string variable in a list?

python,string,list,pygame,filenames
I'm a beginning pygamer trying to upgrade a text game I wrote to a gui game. animals = {dog: "Dog" 4 "Bone", cat: "Cat" 4 "Yarn", parrot: "Parrot" 2 "Bell"} pet = animals[dog].split() pet.append(pygame.image.load('//home/me/Desktop/Python/'+pet[0]+'.png') If I were to input the above code and try to run it I get: pygame.error:...

Safe to use random numbers to make filenames unique?

c#,unique,filenames
I'm writing a program which basically processes data and outputs many files. There is no way it will be producing more than 10-20 files each use. I just wanted to know if using this method to generate unique filenames is a good idea? is it possible that rand will choose,...

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...

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...

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...

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...