Forum › Forums › Official Releases › antiX-21/22 “Grup Yorum” › [SOLVED]: Batch file renaming programs
- This topic has 46 replies, 11 voices, and was last updated May 8-6:34 pm by blur13.
-
AuthorPosts
-
April 24, 2022 at 12:56 am #81979Member
scruffyeagle
::Checking, I found gdebi & its dependencies via Synaptic – installed them all.
BUT – it turns out that gdebi is only for installing .deb packages residing on the local machine. It can’t retrieve & install from remote sources.
And, since I don’t have the Xnview package on my machine, it had nothing to do.
April 24, 2022 at 1:01 am #81980Memberscruffyeagle
::root@M6300A214:/home/spirit# apt install XnviewMP-linux-x64.deb
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
E: Unable to locate package XnviewMP-linux-x64.deb
E: Couldn’t find any package by glob ‘XnviewMP-linux-x64.deb’April 24, 2022 at 1:14 am #81981Memberscruffyeagle
::I did a little searching via startpage.com, and all the links that came up for the search term “XnviewMP-linux-x64.deb”, were links for UBUNTU or LINUX MINT. This would explain why I’m not finding it in the normal Antix repos.
April 24, 2022 at 1:32 am #81982Memberscruffyeagle
::I tracked down a page at How to install XnViewMP which had instruction for installing into Debian-derived systems. It contained a section holding these following 3 lines of commands:
$ sudo apt-get install gdebi
$ wget download.xnview.com/XnViewMP-linux-x64.deb
$ sudo gdebi XnViewMP-linux-x64.deb
———————————-I’d already installed gdebi, so I skipped to the 2nd line. Running that in terminal returned:
–2022-04-23 20:20:20– http://download.xnview.com/XmViewMP-linux-x64.deb
Resolving download.xnview.com (download.xnview.com)… 178.33.105.203
Connecting to download.xnview.com (download.xnview.com)|178.33.105.203|:80… connected.
HTTP request sent, awaiting response… 301 Moved Permanently
Location: https://download.xnview.com/XmViewMP-linux-x64.deb [following]
–2022-04-23 20:20:20– https://download.xnview.com/XmViewMP-linux-x64.deb
Connecting to download.xnview.com (download.xnview.com)|178.33.105.203|:443… connected.
HTTP request sent, awaiting response… 404 Not Found
2022-04-23 20:20:21 ERROR 404: Not Found.—————————–
Just to be 100% sure it had actually failed, I ran that 3rd line (again).
The result was:
gdebi error, file not found: XnViewMP-linux-x64.deb
—————————It looks to me, like the Xnview program was moved to a new location, and later deleted.
April 24, 2022 at 2:16 am #81986Memberscruffyeagle
::I went to XnView’s homepage, clicked on the button labelled “Linux DEB 64 bit”, and downloaded “XnViewMP-linux-x64.deb”.
In Terminal, I typed the command “sudo gdebi XnViewMP-linux-x64.deb”
It asked if I want to install the software package, and I told it “y” for yes.
It displayed on screen:
/usr/bin/gdebi:113: FutureWarning: Possible nested set at position 1
c = findall(“[[(](\S+)/\S+[])]”, msg)[0].lower()
Selecting previously unselected package xnview.
(Reading database … 209098 files and directories currently installed.)
Preparing to unpack XnViewMP-linux-x64.deb …
Unpacking xnview (0.99.7) …
Setting up xnview (0.99.7) …
Processing triggers for desktop-file-utils (0.26-1) …
Processing triggers for mailcap (3.69) …
———————It seemed to me, as if it was done. BUT, I can’t find any launcher for XnView, anywhere in the Menus.
I tried using /Menu/Run/XnView – and it threw up an error box. (See attached screenshot.) I also tried several other variants of the name, appending such as “MP”, ” MP”, “Multi Platform”, etc. Nothing worked.Checking further, I found /usr/share/applications/XnView.desktop.
I copied it, and pasted the link onto my desktop.When I clicked on the desktop link, the program worked!
Attachments:
April 24, 2022 at 2:57 am #81988Memberscruffyeagle
::Update:
I refreshed the menu, using /Control Centre/Maintenance/Menu Editor, and XnView became visible in the Menu/Applications/Graphics subfolder.
It’s still unavailable via the Menu/Run dialog box.
April 24, 2022 at 7:15 am #81994Member
sybok
::Hi, I usually do batch renaming as follows:
1) for-loop
for f in *.jpg; do mv "$f" "${f/img_/birthday_}"; done
The new name can be constructed also with more complex (but still real 🙂 ) substitutions such as the below one using the ‘sed’ utility:
"$(echo "$f" | sed -u 's@img_@birthday_@')"
sed allows to use different separators, e.g. ‘@’, to avoid the need to handle/escape path separator ‘/’.2) list files and then do a while read loop
find ./ -type f -iname '*.jpg' | sort > F.txt while read -r f; do mv "$f" "${f/img_/birthday_}"; done < F.txtListing files has the advantage that I can grep some subset from the file ‘F.txt’.
Recommended reading for further manipulations: https://unixutils.com/string-manipulation-with-bash/
- This reply was modified 1 year ago by sybok. Reason: find improved
April 24, 2022 at 9:04 am #82004Member
oops
::Maybe the XnView appimage (amd64) will be easier for you :
http://download.xnview.com/XnView_MP.glibc2.18-x86_64.AppImage
(I have the .deb version on antiX19, antiX21, MX19, MX21, and work fine here )
- This reply was modified 1 year ago by oops.
April 26, 2022 at 1:22 pm #82096Member
dirkd
::Maybe something to consider: there’s a portable windows utility called ‘Bulk renamer’ that behaves very decently under Wine. It has more options than you care for, and a somewhat crowded interface, but works like a charm. I use it regularly, with a hot-key defined in zzzFM file manager, so that it starts automatically in the folder that is being shown.
April 26, 2022 at 8:26 pm #82137Memberscruffyeagle
::Hi, I usually do batch renaming as follows:
1) for-loop
for f in *.jpg; do mv "$f" "${f/img_/birthday_}"; done
The new name can be constructed also with more complex (but still real 🙂 ) substitutions such as the below one using the ‘sed’ utility:
"$(echo "$f" | sed -u 's@img_@birthday_@')"
sed allows to use different separators, e.g. ‘@’, to avoid the need to handle/escape path separator ‘/’.2) list files and then do a while read loop
find ./ -type f -iname '*.jpg' | sort > F.txt while read -r f; do mv "$f" "${f/img_/birthday_}"; done < F.txtListing files has the advantage that I can grep some subset from the file ‘F.txt’.
Recommended reading for further manipulations: https://unixutils.com/string-manipulation-with-bash/
Oh, boy…(!)
30 years ago, I was doing similar codings for batch files in DOS; parsing text files, and manipulating strings. Then, my ex-wife happened. I’ve known Linux had this capability, but never got around to trying to learn it. Maybe it’s time to do so? Thanks for the link. I’ll look into it.April 26, 2022 at 8:30 pm #82138Memberscruffyeagle
::Maybe the XnView appimage (amd64) will be easier for you :
http://download.xnview.com/XnView_MP.glibc2.18-x86_64.AppImage
(I have the .deb version on antiX19, antiX21, MX19, MX21, and work fine here )
Thanks for the suggestion, but I’ve already got a working copy of XnViewMP installed from .deb, and it’s working properly. (“If it ain’t broke, don’t fix it!”)
April 26, 2022 at 8:38 pm #82139Memberscruffyeagle
::Maybe something to consider: there’s a portable windows utility called ‘Bulk renamer’ that behaves very decently under Wine. It has more options than you care for, and a somewhat crowded interface, but works like a charm. I use it regularly, with a hot-key defined in zzzFM file manager, so that it starts automatically in the folder that is being shown.
I experimented with Wine about 14 years ago, when I first started changing from Windows to Linux. But, I had problems with the filing system. Wine set up its own DOS style filing system, and I couldn’t get it to access or save files in my Linux filing system. I also couldn’t access files in the Wine DOS, using application programs from Linux. So, I abandoned the attempt. Have they solved the filing systems interface, since then?
April 26, 2022 at 10:00 pm #82143Member
dirkd
::I experimented with Wine about 14 years ago, when I first started changing from Windows to Linux. But, I had problems with the filing system. Wine set up its own DOS style filing system, and I couldn’t get it to access or save files in my Linux filing system. I also couldn’t access files in the Wine DOS, using application programs from Linux. So, I abandoned the attempt. Have they solved the filing systems interface, since then?
Yes, sure, a program started under wine can access the full linux file system. It shows the root folder ‘/’ in its file selection dialogs. Conversely, you can easily access the windows C:-drive from the linux file manager. As a rule, I don’t use wine if I can avoid it, but there are these four windows utilities that I love too much to ditch, Bulk Renamer being one of them.
April 26, 2022 at 10:28 pm #82145MemberRobin
::Bulk Renamer
bulk renaming is a task on linux which requires at least basic knowledge about programming… You are expected to know and understand complex command syntax, regex, piping etc. to do this.
So really I can understand your feelings about this bulk renamer. Maybe there is an equivalent GUI tool in Linux, I don’t know.Another one I use frequently is mp3directcut, which I don’t have found a linux equivalent replacement in terms of easy handling and functionallity, alowing cutting and merging mp3s without need of recoding them.
Windows is like a submarine. Open a window and serious problems will start.
April 27, 2022 at 1:17 am #82148Member
iznit
::cutting and merging mp3s without need of recoding them
okay, check it out ➔ https://linuxconfig.org/joining-mp3-music-files-to-a-single-track
-
AuthorPosts
- You must be logged in to reply to this topic.
