List Files in Date Created Order
Moderator: Neosoft Support
List Files in Date Created Order
Hi all, anyone got any suggestions on how to list 3 different folders containing images and gifs and mp4s into a single file in date creation order? - I have been trying with the Dir command and can do single folder but am really wanting to combine all 3 lists into a single list in date creation order containing the date and time and filename (e.g. 04/04/2018 09:11 filename.jpg) Folder1 with .jpgs, Folder2 with .gifs and Folder3 with .mp4s all into a single text file in date creation order. A little stumped here lol. Thanks for any suggestions.
Re: List Files in Date Created Order
ajhunt:
2) redirect the output of your subsequent dir commands to be appended to the same file e.g. ...
3) sort the file (using the sort command) e.g. ...
Note:
1) do not include the { and } in the dir commands above
2) the /+16 in the sort command tells it to sort the lines using the first 16 characters in each line (assuming they are of the form 04/04/2018 09:11)
3) if you use the NeoBook Run command for each dir and sort dos-command, make sure you specify the "wait" option to ensure the commands are executed in the intended order; alternatively, Run a single .bat file with these commands in it.
1) redirect the output of your first dir command to a file e.g. ...I have been trying with the Dir command and can do single folder but am really wanting to combine all 3 lists into a single list in date creation order containing the date and time and filename (e.g. 04/04/2018 09:11 filename.jpg) Folder1 with .jpgs, Folder2 with .gifs and Folder3 with .mp4s all into a single text file in date creation order.
Code: Select all
dir {your command parameters and switches go here} > c:\filelist.txt
Code: Select all
dir {your command parameters and switches go here} >> c:\filelist.txt
Code: Select all
sort" /+16 c:\filelist.txt /O c:\sortedfilelist.txt
1) do not include the { and } in the dir commands above
2) the /+16 in the sort command tells it to sort the lines using the first 16 characters in each line (assuming they are of the form 04/04/2018 09:11)
3) if you use the NeoBook Run command for each dir and sort dos-command, make sure you specify the "wait" option to ensure the commands are executed in the intended order; alternatively, Run a single .bat file with these commands in it.
Re: List Files in Date Created Order
Hi Gaev, thanks for the reply. I thought I had deleted the post after I had posted it lol. I found a way but yours is a cleaner way so again thankyou for your experience. Using the /OD switches worked great and fast enough too. Thanks Gaev as your always a great source of help and advice and always appreciated.
Re: List Files in Date Created Order
Try this:
If have a problem with this info:
1)
File_Bame :Zone.Identifier:$DATA
look this
https://askubuntu.com/questions/65101/w ... event-them
2)
dir *.EXT1 /R /OD > FILE.txt
dir *.EXT2 /R /OD >> FILE.txt
dir *.EXTn /R /OD >> FILE.txt
3)
Depurar el FILE.txt
If have a problem with this info:
1)
File_Bame :Zone.Identifier:$DATA
look this
https://askubuntu.com/questions/65101/w ... event-them
2)
dir *.EXT1 /R /OD > FILE.txt
dir *.EXT2 /R /OD >> FILE.txt
dir *.EXTn /R /OD >> FILE.txt
3)
Depurar el FILE.txt
COSTA RICA
PURA VIDA
PURA VIDA
Re: List Files in Date Created Order
Depurar FILE.txt
Code: Select all
FileLen "l1.txt" "[sz]"
loop "1" "[sz]" "[c]"
:Ini
fileRead "l1.txt" "[c]" "[Lin]"
substr "[Lin]" "1" "1" "[ch]"
SearchStr "[ch]" "0123456789" "[ps]" ""
if "[Ps]" "=" "0"
FileDelLine "l1.txt" "[c]"
if "[c]" "=" "[sz]"
exit "" ""
endif
math "[sz]-1" "" "[sz]"
gotoline "Ini"
endif
endloop
exit "" ""
COSTA RICA
PURA VIDA
PURA VIDA
Re: List Files in Date Created Order
Thank you so much Virger, will definately use the sorting code - thanks so much for your time and efforts supporting yet another NeoBook users. Really appreciated Virger.
Re: List Files in Date Created Order
ajhunt, virger:
A simpler way to exclude the extraneous lines from the dir command is to ...
A simpler way to exclude the extraneous lines from the dir command is to ...
Code: Select all
dir c:\path\to\giffolder\*.gif | find ".gif" > c:\filelist.txt
dir c:\path\to\jpgfolder\*.jpg | find ".jpg" >> c:\filelist.txt
dir c:\path\to\mp4folder\*.mp4 | find ".mp4" >> c:\filelist.txt
sort" /+16 c:\filelist.txt /OD c:\sortedfilelist.txt
Re: List Files in Date Created Order
Many thanks Gaev, always a better way lol - thank you yet again PM'd you Gaev.