[SOLVED]: Batch file renaming programs

Forum Forums Official Releases antiX-21 “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.
Viewing 15 posts - 16 through 30 (of 47 total)
  • Author
    Posts
  • #81979
    Member
    scruffyeagle
    Helpful
    Up
    0
    ::

    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.

    #81980
    Member
    scruffyeagle
    Helpful
    Up
    0
    ::

    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’

    #81981
    Member
    scruffyeagle
    Helpful
    Up
    0
    ::

    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.

    #81982
    Member
    scruffyeagle
    Helpful
    Up
    0
    ::

    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.

    #81986
    Member
    scruffyeagle
    Helpful
    Up
    0
    ::

    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!

    #81988
    Member
    scruffyeagle
    Helpful
    Up
    0
    ::

    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.

    #81994
    Member
    sybok
    Helpful
    Up
    2
    ::

    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.txt

    Listing 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 2 months, 1 week ago by sybok. Reason: find improved
    #82004
    Member
    oops
    Helpful
    Up
    0
    ::

    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 2 months, 1 week ago by oops.
    #82096
    Member
    dirkd
    Helpful
    Up
    0
    ::

    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.

    #82137
    Member
    scruffyeagle
    Helpful
    Up
    0
    ::

    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.txt

    Listing 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.

    #82138
    Member
    scruffyeagle
    Helpful
    Up
    0
    ::

    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!”)

    #82139
    Member
    scruffyeagle
    Helpful
    Up
    0
    ::

    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?

    #82143
    Member
    dirkd
    Helpful
    Up
    0
    ::

    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.

    #82145
    Member
    Robin
    Helpful
    Up
    0
    ::

    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.

    #82148
    Member
    iznit
    Helpful
    Up
    0
    ::

    cutting and merging mp3s without need of recoding them

    okay, check it out https://linuxconfig.org/joining-mp3-music-files-to-a-single-track

Viewing 15 posts - 16 through 30 (of 47 total)
  • You must be logged in to reply to this topic.