Page 5 of 14

Posted: Sun 11 Mar 2012, 11:48
by SFR
don570 wrote:For instance does anybody know where there's a script to rename
files in a given folder according to modification date

fileX fileY fileZ to fileX000 fileY001 fileZ003

(the sorting depends on modification date of the file
rather than alphabetical)
It'd be very useful, I'm using it sometimes under Windowze ("FileMenu Tools" application).
Could be something like this?

Code: Select all

#!/bin/bash

# batchaddnum by SFR'2012
# Usage: batchaddnum <folderpath> (DO NOT USE ENDING / PLEASE!)

FOLDERPATH=$1

# Dump all filenames from FOLDERPATH into temporary file
# 'ls -t' option sorts filenames in date order ('-tr' for reversed date order)
# 'tail -n +2' removes "Total..." line
# 'egrep -v '^d' removes directories and '^l' removes links
# next 'cut's to leave only filename

ls "$FOLDERPATH" -A -o -t | tail -n +2 | egrep -v '^d' | egrep -v '^l' | cut -f2- -d ':' | cut -b 4- > /tmp/batchfileslist

# And finally rename all files adding numeric suffix

CNT=1
while read LINE; do
  OLDNAME=$FOLDERPATH"/"$LINE
  if [ ${#CNT} -eq 1 ]; then CNT="00"$CNT; fi
  if [ ${#CNT} -eq 2 ]; then CNT="0"$CNT; fi  
  NEWNAME=$OLDNAME$CNT
  mv "$OLDNAME" "$NEWNAME"
  let CNT=10#$CNT+10#1
done < /tmp/batchfileslist

rm -f /tmp/batchfileslist
exit
It's just an example, not optimized nor extensively tested, but works with hidden files as well as spaces in file- and foldernames, excludes folders and symlinks, and should be easy to expand.

Also, I've been thinking about using find FOLDERNAME -maxdepth 1 -type f, then stat -c %Y FILENAME and then join times and filenames and use sort...

Hope I saved you some time.
Greetings!

Posted: Sat 17 Mar 2012, 20:08
by don570
Thanks for the info. I didn't see it in time so I used
my own crude method. :oops:

You can test it here.



http://murga-linux.com/puppy/viewtopic. ... 812#612812

I have prepared a nice right click option package
to do renaming of filenames with lots of features
but I found a nasty bug so I can't release it!!
I'll continue to work on it.

___________________________

Posted: Mon 19 Mar 2012, 06:15
by aarf
can we have fsck in right click?

New version 5.9.1

Posted: Tue 20 Mar 2012, 17:28
by don570
New version 5.9.1 of right-click

I added or changed three apps

1) Baconrecorder 2.7 - just cosmetic changes

2) Rename-files 1.3 - I wrote this to make some simple changes
to filenames when the files are in a folder

3) dependency check by RSH - version .3 -- uses ldd command

It is still being improved by RSH. There is a better version that will
check libraries.
http://murga-linux.com/puppy/viewtopic. ... ca7aaaa650
________________________________________________

new Version 5.9.2

Posted: Thu 22 Mar 2012, 23:19
by don570
Version 5.9.2 (march 22) dependency check and rename-files upgraded again

The numbering of files in a folder works correctly now

file_000 is the oldest :wink:

___________________________________________

Posted: Sat 24 Mar 2012, 20:33
by don570
version 5.9.3

Update:
I'm continuing to work on Rename-files.
The warning messages (about similar file names)
still need improvement. :oops:

_________________________________________

Posted: Wed 28 Mar 2012, 17:19
by pemasu
http://www.murga-linux.com/puppy/viewto ... 451#615451

Not sure if postscript viewer rox right click has been included. The above url provides small pet to do it. It has just small script and rox right click stuff. It should work with epdf and evince.

Posted: Sat 31 Mar 2012, 20:27
by don570
To Pemasu:
I'll look into how PDF files are opened.
I don't think I assumed that evince was installed.

__________________________________________

new version of right click 5.9.4

I am continuing to work on rename-files.

I think I have any nasty bugs fixed but I will still changea couple of
summary windows in the next week.

_______________________________________

new version 5.9.5

Posted: Mon 02 Apr 2012, 21:05
by don570
new version 5.9.5

New features:

1) rename-files fixed (yet again) :oops:
2 empty-files added ---- this right click option creates empty files
-very useful for a programmer or databases :lol:
3 added pemasu right click for postscript files

Saluki

Posted: Thu 19 Apr 2012, 17:10
by Pete22
Does this program work with Saluki?

Pete

Posted: Sat 21 Apr 2012, 16:56
by don570
Does this program work with Saluki?
No I don't know the method to put options on the
right click menu.

I tried here with rename-files

http://www.murga-linux.com/puppy/viewto ... 004#618004

but it shows on the 'Send to' menu for all files when
what I want is for rename files to show only for folders.

Yad right click file search

Posted: Sun 29 Apr 2012, 07:53
by Geoffrey
I came across a zenity search script meant for Thunar custom actions, I have modified it for yad and changed some of the code so it now works as it supposed to.

I won't make a pet of it, as it won't uninstall correctly, maybe someone will find some use for it.

It is a basic search, type in the name click ok, then double click the result to open the containing directory.

Code: Select all

#!/bin/bash 
#search-for-files 

maxresults=500 

window_icon="mini-zoom" 

# this script will work for any environment that has bash and yad, so the filemanager is entirely down to you! you can add extra arguments to the string as long as the last argument is the path of the folder you open 
filemanager="rox" 

window_title="Search for Files" 

srcPath="$*" 

if ! [ -d "$srcPath" ] ; then 
cd ~/ 
srcPath=`yad --file-selection --directory --title="$window_title - Look in folder" --window-icon="$window_icon"` 
fi 

if [ -d "$srcPath" ] ; then 

fragment=`yad --entry --title="$window_title - Name contains:" --window-icon="$window_icon" --text="Search strings less than 2 characters are ignored"` 
if ! [ ${#fragment} -lt 2 ] ; then 

( 

echo 10 
O=$IFS IFS=$'\n' files=( `find "$srcPath" -iname "*$fragment*" -printf \"%Y\"\ \"%f\"\ \"%k\ KB\"\ \"%t\"\ \"%h\"\\\n | head -n $maxresults` ) IFS=$O 
echo 100 

selected=`eval yad --list --title=\"${#files[@]} Files Found - $window_title\" --window-icon="$window_icon" --width="600" --height="400" --text=\"Search results:\" --print-column=5 --column \"Type\" --column \"Name\" --column \"Size\" --column \"Date modified\" --column \"Path\" ${files[@]}` 

if [ -e "${selected%|}" ] ; then "$filemanager" "${selected%|}" ; fi 

) | yad --progress --auto-close --pulsate --title="Searching..." --window-icon="$window_icon" --text="Searching for \"$fragment\"" 

fi 

fi 

exit 0

Posted: Mon 30 Apr 2012, 16:34
by don570
Note to Geoffrey : You should read the script by SFR called
Large file finder which also makes a list of files that
can be double clicked. It doesn't use YAD

http://murga-linux.com/puppy/viewtopic.php?t=77779


Actually what I want is a simple utility to find a file based on date.

For instance I want to find all documents written in past week.

I can't get pfind to work correctly doing this even though it
appears to have this functionality.

_______________________________________________

_________________________________________________

New version 5.9.

Posted: Mon 30 Apr 2012, 16:40
by don570
New version 5.9.6

Added split-file to split up mp3 or txt files in smaller chunks
that might be more manageable.

Upgraded rename-files 4.8

Added in SFR's Large file finder
which can be useful to track down larger files.

_______________________________________________

fast find

Posted: Fri 04 May 2012, 00:07
by don570
I made another right click app to find a file fast
but it needs YAD to be installed
so I won't put it in this pet package

http://murga-linux.com/puppy/viewtopic. ... 963#624963

_____________________________________________________

Posted: Mon 25 Jun 2012, 00:50
by oldyeller
Hello,

Will this work on Slacko 533

Posted: Mon 25 Jun 2012, 18:48
by don570
I've tested it on Slacko 531 so it should work with
future versions. Occasionally developers change a link
or the wording of a right click menu item and that
causes a dead menu item to appear . That can
be fixed by the user by just dragging it to the trash can .

______________________________________________

Posted: Tue 26 Jun 2012, 17:36
by vicmz
It didn't work for me on latest Slacko 5.3.3 menus remain as usual. Works in Wary 5.3 though. Maybe UTF-8 has something to do, I know there's espanol-right-click but I find it outdated compared to the original, which is more fulfeatured.

Posted: Tue 26 Jun 2012, 18:04
by oldyeller
I did have success on Slacko 533

I have already used it to make sfs

New version 1.9.7

Posted: Wed 27 Jun 2012, 23:50
by don570
New version 5.9.7

Download available on first page


I checked on Slacko 533 which has been just released.

I noticed that Slacko doesn't have a method to check MD5sum
so I added my version of Check MD5sum.

It will only be seen when Slacko is used.
A comparison of MD5sums can be made to see if download was successful.

______________________________________________