Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
rot 13'ing all file extensions in a folder
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
lloyd  
View profile  
 More options Nov 10 2012, 9:11 pm
Newsgroups: comp.unix.shell
From: lloyd <lloyd.hough...@gmail.com>
Date: Sat, 10 Nov 2012 18:11:26 -0800 (PST)
Local: Sat, Nov 10 2012 9:11 pm
Subject: rot 13'ing all file extensions in a folder
Could anyone provide a simple script to rot 13 all file extensions
(all alphabetic characters after the last period, preserving case) in
the current directory?

Sorry not to even try myself. It's been years. I don't mind which
flavour of shell. Thanks.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Janis Papanagnou  
View profile  
 More options Nov 10 2012, 9:28 pm
Newsgroups: comp.unix.shell
From: Janis Papanagnou <janis_papanag...@hotmail.com>
Date: Sun, 11 Nov 2012 03:28:45 +0100
Local: Sat, Nov 10 2012 9:28 pm
Subject: Re: rot 13'ing all file extensions in a folder
On 11.11.2012 03:11, lloyd wrote:

> Could anyone provide a simple script to rot 13 all file extensions
> (all alphabetic characters after the last period, preserving case) in
> the current directory?

One possibility (with modern shells)...

    for f in *.*
    do
        ext=$( tr "a-zA-Z" "n-za-mN-ZA-M" <<< "${f##*.}" )
        mv -i "$f" "${f%.*}.${ext}"
    done

Janis


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
lloyd.hough...@gmail.com  
View profile  
 More options Nov 10 2012, 9:44 pm
Newsgroups: comp.unix.shell
From: lloyd.hough...@gmail.com
Date: Sat, 10 Nov 2012 18:44:15 -0800 (PST)
Local: Sat, Nov 10 2012 9:44 pm
Subject: Re: rot 13'ing all file extensions in a folder

Janis Papanagnou wrote:
>> Could anyone provide a simple script to rot 13 all file extensions
>> (all alphabetic characters after the last period, preserving case) in
>> the current directory?

> One possibility (with modern shells)...

>   for f in *.*
>     do
>         ext=$( tr "a-zA-Z" "n-za-mN-ZA-M" <<< "${f##*.}" )
>         mv -i "$f" "${f%.*}.${ext}"
>     done

Thanks so much Janis! This is very clever.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Combs  
View profile  
 More options Dec 7 2012, 7:31 pm
Newsgroups: comp.unix.shell
From: dkco...@panix.com (David Combs)
Date: Sat, 8 Dec 2012 00:31:16 +0000 (UTC)
Local: Fri, Dec 7 2012 7:31 pm
Subject: Re: rot 13'ing all file extensions in a folder
In article <3db525ba-57f9-41ec-affe-8e6399d29d6d@googlegroups.com>,

gnu Emacs has some nice stuff for that kind of thing.

Here are some notes to myself:

(01)(06)(09).mp3   09 06 01
army style: dayNum=1 monthNum=2 YrNum=3
sortable:   YrNum=3 monthNum=2 dayNum=1

(dired-do-rename-regexp "\\(globalresearch\\)\\([0-9][0-9]\\)\\([0-9][0-9]\\)\\([0-9][0-9]\\).mp3" "GR-\\3\\2\\4.mp3")
(dired-do-rename-regexp "\\(GR-\\)\\([0-9][0-9]\\)\\([0-9][0-9]\\)\\([0-9][0-9]\\).mp3" "\\1\\4\\3\\2.mp3")

I use the above to change the name of .mp3-files from a particular
place (globalResearch.ca -- HAVE A LOOK!) to change the format
and order of date parts so that they'll sort, ie be listed in
the order I want, thata is, by date (I rearrange the date and
move it to the left side of the file-name).

where that function is described (by emacs) as:

 |  % R runs the command dired-do-rename-regexp
 |    which is an interactive compiled Lisp function in `dired-aux.el'.
 |  It is bound to % r, % R, <menu-bar> <regexp> <rename>.
 |  (dired-do-rename-regexp regexp newname &optional arg whole-name)
 |
 |  Rename selected files whose names match regexp to newname.
 |
 |  With non-zero prefix argument arg, the command operates on the next arg
 |  files.  Otherwise, it operates on all the marked files, or the current
 |  file if none are marked.
 |
 |  As each match is found, the user must type a character saying
 |    what to do with it.  For directions, type C-h at that time.
 |  newname may contain \<n> or \& as in `query-replace-regexp'.
 |  regexp defaults to the last regexp used.
 |
 |  With a zero prefix arg, renaming by regexp affects the absolute file name.
 |  Normally, only the non-directory part of the file name is used and changed.

Another emacs example is this function (via dired-x.el, I think):

*** WDIRED:  M-x wdired-change-to-wdired-mode --> mode-line: "[(Editable Dired)]"   dired-edit
            rename files via simply **EDITING** the names IN THE DIRED BUF ITSELF!
  Command: Toggle Dired-Omit mode.

Hope this helps SOMEONE!

David


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »