Create a file listing that contains the created date of the file - iphone

I'm trying to copy photos from someone's iphone to my windows laptop. The problem is the photos on the iphone save as filename like IMG 360, IMG 361 etc... but this isn't helpful when I want to copy these and organise by a certain filename and date created.
I use Google Photos and my own backup to organise photos in chronological order.
We went on holiday together and I am trying to find the best way to get their files organised and merged in with my own photos so that they appear in the right chronological order.
Unless there is a better way to do this, I am trying to create a file listing using a BAT file to list all the files together with their CREATED DATE and then I will create another BAT file to rename those files by incorporating their CREATED DATE.
Any ideas?
Thanks Chirag
I tried the below but this is supposed to only organise in chronological order, but it doesn't seem to even do that.
dir /a /b /-p /s /T:C /o:gen >filelisting.txt

You can use the command dir /T:C /O:D > filelisting.txt to create a file listing that contains the created date of each file in a directory.

Related

merging multiple pdf files into one per file name using PDFtk pro

I have a situation that I need to merge files again by file names. Now, I have files in one folder like this -
A1.pdf,
A2.pdf,
B1.pdf,
C1.pdf,
C2.pdf,
C3.pdf.
The goal is to merge files by file names and I will get A.pdf, B.pdf, C.pdf. I tried different things in the batch file, but none worked so far. Can you please help?
The real files names are like this below.
115_11W0755_70258130_841618403_01.PDF
115_12W0332_70258122_202990692_01.PDF
115_12W0332_70258122_202990692_02.PDF
115_12W0332_70258122_202990692_03.PDF
115_14W0491_70258174_562605608_01.PDF
115_14W0491_70258174_562605608_02.PDF
115_14W0776_70258143_680477806_01.PDF
115_16W0061_70258083_942231888_01.PDF
115_16W0065_70258176_202990692_01.PDF
115_16W0065_70258176_202990692_02.PDF
the 3rd part (70258083) is the element that works as uinque per batch. In other words, I want to merge files per this element. from the file names listed above, there will be 6 PDF files.
I am using the batch script below to merge two files into one. I don't know how to tweak this to more than 2 files to merge OR leave a single file alone.
Please help.
setlocal enabledelayedexpansion
for %%# in (115_*.pdf) do (
set n=%%~n#
set n=!n:~,-30!
pdftk A=!n!.pdf B=%%# cat B A output C:\IN\_fileNames\Merge\Files\!n!.pdf
)
here is the error screen

delete files with numbered names in matlab directory

I'm new to matlab and I've wrote a code that implements the gamma function for image processing. I generate around 300 photos named '001.jpg' to '300.jpg' and then use ffmpeg to make a video.
In the end, I only need the video result and need a command to delete all the photos generated in the directory! is there a way to do that?
If you want to remove all .jpg files in the current directory you can use the delete command with a wildcard (*)
delete('*.jpg')
If the files live in a folder other than the current directory, you can specify the directory in this way.
folder = '/path/to/my/files';
delete(fullfile(folder, '*.jpg'))
If you want to limit it to just files that have number filenames, you could do something like the following
files = dir('*.jpg');
filenames = regexp({files.name}, '^[0-9]+\.jpg$', 'match', 'once');
filenames = cellstr(cat(1, filenames{:}));
delete(filenames{:})
Adding to Suever's answer (not allowed to comment yet):
Assuming you already know the names of the images you're creating, you could save your script a 'trip' to the folder and back by creating the filenames list yourself thus:
for i=1:numOfImages
filenames(i)={strcat(num2str(i),'.jpg')};
end
delete(filenames{:})

Batch: Create a Folder and Name it by Today's Date

How can I make a batch file that will create a folder (in a specified directory) that will create a folder and label it with today's date? Can I also make it delete folders that are one week old or older?
One question at a time. Addressing your first one:
cd \YourSpecificDirectory
SET Today=%Date:~10,4%%Date:~4,2%%Date:~7,2%
REN Creates folder in format 20050812 (depending on regional settings and language)
md %Today%
Answers to your second question (how to delete a folder before a certain date) already exist here. A search should find them for you pretty easily.
Please see this post how to get data value independent of data/Time format (zone):
batch file to copy some files and changing their name

Split Filename Up to Define Variables

I have a script I created to help with converting a video then uploading it to our website. Our videos all have a standard format for their filename to help with setting them up correctly (day, month, year; i.e. 09OCT2013.m4v). They get filed into directories from year to month to day (i.e. 2013/oct/09OCT2013/09OCT2013.m4v). Right now, my script opens by asking for user input for the year then month then the actual file name for the folder. What I want to do is take the file that has already been created, drop it into the script, then have the script take it apart and put it in the appropriate file (i.e. drop the file 12JUN2012.m4v into the script and the script automatically puts it into 2012/jun/12JUN2012/). Is there any possible way to do this in terminal? Please let me know if any part of my question is unclear.
Assuming that you're using bash:
for file in "$#"
do
dd=${file:0:2}
mm=${file:2:3}
yy=${file:5:4}
mv "$file" "$yy/$mm/$file"
done
If the file needs to be moved further, or is supplied with more pathname, you can adjust the script, but the basic idea of splitting the last component of the file name up using the substring notation is good.

C# folder and subfolder

Upon numerous searches, I am here to see if someone has any idea on how I should go about tackling this issue.
I have a folder with sub-folders. The sub-folder containers each has files of different file types e.g. pdf, png, jpeg, tiff, avi and word documents.
My goal is to write a code in C# that will go into the subfolder, and combined all the files into one pdf using the name of the folder. The only exception is that a file such as avi will not be pdf'ed in which case I want a nudge as to which folder it is and possibly file name. I am trying to use the form approach, so that you can copy in the folder pathname and also destination of the created pdf.
Thanks.
to start, create a FolderBrowserDialog to get the root folder. Alternatively just make a textbox in which you paste the folder name ( less preferred since the first method gives you nicer error-handling straight out of the box )
In order to iterate through, see How to: Iterate Through a Directory Tree
To find the filetype, check System.IO.FileInfo.Extension for each file you iterate through. Add those to list with the data you need. ( hint, create a list of objects in which your object reflects the data you need such as path, type etc,... ). If its an avi don't toss it in the list but flash a warning (messagebox?) instead.
From here the original question gets fuzzy. What exactly do you need in the pdf. Just the filenames and locations or do you actually want to throw the actual contents of the file in pdf?