Hello,
i have log files for every single day with the file format "yyyyMMdd.txt".
how can i move all files except the current day to another folder?
Move files except the last file
Moderator: Martin
- digitalstone
- Posts: 342
- Joined: 21 Oct 2017 12:36
- Location: The Netherlands
Re: Move files except the last file
Are you familiar with loop iterations?
you could first store the amount of files within your folder, inside a list.
Then inside the loop:
look at each upfollowing file.
If its name equals today's date, then "don't copy" else "copy".
you could first store the amount of files within your folder, inside a list.
Then inside the loop:
look at each upfollowing file.
If its name equals today's date, then "don't copy" else "copy".
Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)
Re: Move files except the last file
I found the following solution from Desmanto in the other thread:
viewtopic.php?f=5&t=6905
Only need the single line script
Then use {files,listformat,comma} at the Action Move Files.
viewtopic.php?f=5&t=6905
Only need the single line script
Code: Select all
removeElement(files, indexOfElement(files, "/storage/emulated/0/source/{getDate(),dateformat,yyyyMMdd.txt}"));
- digitalstone
- Posts: 342
- Joined: 21 Oct 2017 12:36
- Location: The Netherlands
Re: Move files except the last file
Very nice, i wasn't aware of a dedicated function like that.
But for "educational purposes":
Under the hood, i bet it would perform a similar process like i described though.
It has to check every file up til the one you're looking for eventually somehow.
But for "educational purposes":
Under the hood, i bet it would perform a similar process like i described though.
It has to check every file up til the one you're looking for eventually somehow.
Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)