[SOLVED] nzbperl - sorting files by subject

Hi
I need some perl guru to help me out with changing the sort function in nzbperl (http://noisybox.net/computers/nzbperl/nzbperl.pl)
sub sortFilesBySubject {
my $quiet = shift;
my @fileset = @_;
if(!$nosort){
porlp("Sorting files by filename (subject)...", $quiet);
@fileset =
sort {
$a->{'name'} cmp $b->{'name'};
} @fileset;
porlp("finished.\n", $quiet);
return @fileset;
It sorts like this:
r00
r01
r02
rar
I'd like to sort like so:
rar
r00
r01
r02
Thanks for any advice :-)
Last edited by valvet (2010-11-08 14:51:00)

The debug is as follow ('ve changed the real filename as I'm unsure the rules regarding such info here):
[-]-[FULL]-[#something@EFNet]-[ subject_here ]-[1/1] - "filename.nzb" yEnc (1/1)
[-]-[FULL]-[#something@EFNet]-[ subject_here ]-[01/23] - "filename.nfo" yEnc (1/1)
[-]-[FULL]-[#something@EFNet]-[ subject_here ]-[02/23] - "filename.par2" yEnc (1/1)
[-]-[FULL]-[#something@EFNet]-[ subject_here ]-[03/23] - "filename.r00" yEnc (1/40)
[-]-[FULL]-[#something@EFNet]-[ subject_here ]-[04/23] - "filename.r01" yEnc (1/40)
[-]-[FULL]-[#something@EFNet]-[ subject_here ]-[05/23] - "filename.r02" yEnc (1/40)
[-]-[FULL]-[#something@EFNet]-[ subject_here ]-[06/23] - "filename.r03" yEnc (1/40)
[-]-[FULL]-[#something@EFNet]-[ subject_here ]-[07/23] - "filename" yEnc (1/40)
[-]-[FULL]-[#something@EFNet]-[ subject_here ]-[08/23] - "filename.r05" yEnc (1/40)
[-]-[FULL]-[#something@EFNet]-[ subject_here ]-[09/23] - "filename.r06" yEnc (1/40)
[-]-[FULL]-[#something@EFNet]-[ subject_here ]-[10/23] - "filename.r07" yEnc (1/40)
[-]-[FULL]-[#something@EFNet]-[ subject_here ]-[11/23] - "filename.r08" yEnc (1/40)
[-]-[FULL]-[#something@EFNet]-[ subject_here ]-[12/23] - "filename.r09" yEnc (1/40)
[-]-[FULL]-[#something@EFNet]-[ subject_here ]-[13/23] - "filename.r10" yEnc (1/40)
[-]-[FULL]-[#something@EFNet]-[ subject_here ]-[14/23] - "filename.r11" yEnc (1/6)
[-]-[FULL]-[#something@EFNet]-[ subject_here ]-[15/23] - "filename.rar" yEnc (1/40)
[-]-[FULL]-[#something@EFNet]-[ subject_here ]-[16/23] - "filename.sfv" yEnc (1/1)
[-]-[FULL]-[#something@EFNet]-[ subject_here ]-[17/23] - "filename.srr" yEnc (1/1)
[-]-[FULL]-[#something@EFNet]-[ subject_here ]-[18/23] - "filename.vol00+01.par2" yEnc (1/3)
[-]-[FULL]-[#something@EFNet]-[ subject_here ]-[19/23] - "filename.vol01+02.par2" yEnc (1/5)
[-]-[FULL]-[#something@EFNet]-[ subject_here ]-[20/23] - "filename.vol03+04.par2" yEnc (1/9)
[-]-[FULL]-[#something@EFNet]-[ subject_here ]-[21/23] - "filename.vol07+08.par2" yEnc (1/17)
[-]-[FULL]-[#something@EFNet]-[ subject_here ]-[22/23] - "filename.vol15+16.par2" yEnc (1/33)
[-]-[FULL]-[#something@EFNet]-[ subject_here ]-[23/23] - "filename.vol31+06.par2" yEnc (1/13)
Thanks again for taking the time to help with this.

Similar Messages

  • [SOLVED] Auto-sort files in folders

    Came across the "Magic Folder" plasmoid on a friend's KDE setup and liked the idea very much, especially for my downloads folder (I tend to download many things and then go through them later to sort away).
    I found the "Download Sort" plugin for Firefox, but it doesn't always work and doesn't seem to be maintained anymore (last release 2006).
    I also found this shell script on the Ubuntu forums, but it doesn't do what I want.
    Does anyone know of a way (or a ready made program) that could do the following:
    - Check every file that is placed in folder "X" (eg ~/downloads) [not only by Firefox, but always] and automatically distribute them to another folder by mime type or file extension
    - This is not a must, but a nice and useful feature: automatically create subfolders by date for certain file types (useful for PDFs etc., but not needed for videos or music)
    Thanks in advance
    Last edited by JackH79 (2012-05-06 14:15:14)

    I don't know about a ready program, but you can write a simple bash script to do that.
    (I think this is very simalar to your ubuntu link, I can't view it).
    #!/bin/bash
    while read filename; do
    echo -n "$filename "
    case $(file -b --mime-type "$filename") in
    image/png)
    echo "is a png image"
    mv -n "$filename" /somewhere/png/
    image/*)
    echo "is an image"
    mv -n "$filename" /somewhere/otherimages/
    application/pdf)
    echo "is a pdf"
    destdir="/somewhere/pdf/$(date +%Y.%m.%d)"
    if [[ -d "$destdir" ]] || mkdir -p "$destdir"; then
    mv -n "$filename" "$destdir/"
    fi
    echo "has mime $(file -b --mime-type "$filename"). I don't know what to do"
    esac
    done < <( find /path/to/magic/folder -type f )

  • Sorting files according to type in Pcmanfm is not working properly.

    Hi,
    For a long time I just ignored this fact, but as now I'm trying to make everything work as it should, my problem with Pcmanfm bothers me more and more. I would like to sort files according to their types. Nothing easier, right? So I chose "Sort by type" option and got this - (1).
    As you can see, the files are not in the alphabetical order as they should (but are sorted by type) But, when I click on View menu (Widok on the screenshot - (2)) the files jump back to their original, alphabetical order, still being grouped according to types (3).
    Anyone encountered such a problem before? Tried to find something familiar with no results. I'm using FAM with Pcmanfm, maybe there lies the source of my problems?
    I'll provide every information you might need, just ask.

    Hm, so it seems that the problem is on Pcmanfm's side. Thank you skottish (once again), let's hope that this will be solved somehow.
    Ranguvar wrote:I'm an idiot, it appears there's a bug with Gamin and PCManFM. Sorry!
    Really? Didn't know about it, really :roll:

  • Sorting file content of a huge file and less RAM

    Hi,
    I want to sort the content of a big file. In a file each line ended by \n is one record. I want to sort the lines alphabetically.
    for eg.
    The file test.txt contains the following data
    pqr xyz \n
    abc xyz \n
    The sorted file should contain
    abc xyz \n
    pqr xyz \nand also the file size is very big around 20GB. and RAM is very less so it is not even possible to load such a huge file in memory.
    How to solve the above problem? Can anyone suggest me the good solution?
    Thanks

    Getting rid of the file in favor of a database sounds pretty good to me.Have you any clue how much time it will take to insert 20 GB into a relation database?
    I find szgy's solution sutaible for me
    but I think before merging (step 5) the data in
    separate files (compare set of two files) should be
    compared and should be written to a new file. Then
    these resultant files should be compared again tili
    it becomes a single file.you can merge all the files at once to using a heap, hence avoiding unnecessary file-writes.
    >
    The above step is required since I'm reading data
    from a file. I'll be taking the first few lines and
    sorting them and writing into new file. Here each
    file is sorted. but if you merge all the sorted files
    as it is the resultant file will not have sorted data
    since there was no comparision.
    Now I'll have to think upon sorting algorithms and
    merging of files after comparing data between two
    filesYou can email me at [email protected] to get a full working code that does all this for integers, including merging the results with help of a heap.
    For 10000000 (400 MB) it takes (in ms):
    other     read     write sort
    2579     16655     35407     37422
    Total is 80 sek, which is fairly ok for 400 MB of data I think (5 MB/sek) including reads and writes.
    Gil

  • How can I sort files in a folder by name?

    How can I sort files in a folder by name? iFS first sort files that starts with upper-case letter and then files with lower-case letter.
    Like:
    A_file
    B_file
    a_file
    b_file
    I want:
    A-file
    a_file
    B_file
    b_file
    This doesn't help:
    String[] sort_attributes = {"NAME"};
    boolean [] sort_orders = {true};
    SortSpecification sort = new SortSpecification(sort_attributes, sort_orders);
    currentFolder.setSortSpecification(sort);
    Do I have to get all items in a folder and then sort them?
    /Elin

    I do not think there is a way to do that without add-ons
    There are a couple of workarounds I am aware of
    * Add the bookmarks manually in the bookmarks library and choose the position. That is using Show all bookmarks -> open required folder -> select a position and right click -> add new bookmark <br />Rather a slow and clumsy process
    * Sort a folder and copy it. If you sort the folder contents then copy and paste them they remain in that order when pasted.
    There are add-ons but I have not tried them. For example
    * https://addons.mozilla.org/firefox/addon/simplesort-bookmarks/
    * https://addons.mozilla.org/firefox/addon/auto-sort-bookmarks/
    There will be others available and take note of the advice to backup bookmarks manaully.
    * [[Restore bookmarks from backup or move them to another computer#w_manual-backup]]_manual-backup

  • HT2470 How to sort files in finder

    Is there any way to sort files in my finder first by kind (folders, pdfs, jpegs, docxs, etc.) and then by name?  Right now I can only sort by one or the other.  If I sort by kind, the files are grouped according to kind, but the names are mixed up.  If I sort by name, all file types and folders are sorted according to name.  I like the column view because it helps me see the directory structure easily.  I hope that doesn't have any influence on what I'm trying to do.

    Choose View > Arrange By > Kind to group by Kind. Then choose Option-View > Sort By > Name to sort within the Arrange-By groups.
    See this MacWorld article for more info about Finder sorting and arranging.

  • How to sort files

    i wanna sort files that are residing inside a directory in disk using java code... Please help me to do this... I want the code for this...

    I want the code for this...No problems.
    class LazyDoofus {
        public static void main(String[] args) {
            LazyDoofus bite = new LazyDoofus();
            bite.me();
        public void me() {
            System.out.println("Do your own work");
    }

  • Sort files in Finder column view for the current folder only?

    Hi,
    I don't really understand how finder sort settings work, even after using OS X since it first came out. Maybe someone can give me a hand.
    I'm trying to sort files inside one specific folder according to their name decending. In general I have arranged them by label and sorted by file name ascending. Every time I try to use the settings in the "display options" (cmd+J), this applies also to several other folders. Even if I right-click on that particular folder to enter the settings.
    Isn't it possible to apply different sort/arrange options to individual folders?
    p.

    For column view, there is only one arrange/sort, no matter where you are in the hierarchy. It is based on what the arrange/sort was set on the original folder opened.
    In the View Options, the Brows by ??? view checkbox controls what happens when you open a folder from that view. If it is set, then the folder opens in the same view as the enclosing folder. If unchecked, and you have set a view on a folder, that folder will open in the desired view.
    Again, this does not apply in column view. Column view has only one arrange/sort for the entire hierarchy.

  • Elements 10 / Folder Mode sorts files in "file name" order; is there a way to do this in Elements 11

    Elements 10 / Folder Mode sorts files in "file name" order; is there a way to do this in Elements 11

    No not automatically.
    You can p-lace them into an album and then choose Album Order from the dropdown menu and they will remain fixed.

  • Manually sort files in a folder

    Is there anyway to sort files in a folder manually?
    Say I have 4 files. The would be arranged..
    File A
    File B
    File C
    File D
    I want them to be
    File B
    File D
    File A
    File C
    Is there ANYWAY to do this?
    I can't sort them by size or anything like that cause it is going to be more then 100 files in this folder but I need them in a specific order.
    Thank you

    I could but it's folders of pictures I'm going to export to iPhone and I already have the year before the name (2009 Fall). Since it's going to show when it's on my iPad and iPhone it will be too many numbers before the actual name.
    I refuse to use iPhoto. I tried it twice and there is just too much extra in there that I don't need that takes up too much storage (like faces and previews).
    There has to be a way around it somehow...  Getting Lightroom pictures on iPhone shouldn't be this hard..
    Thanks for your help!

  • Sort files in Finder Column View?

    Like to sort files by date in column view, is this possible? I know you can do it in List view, but can't seem to do this in column view. It would have to be folder specific, as the upper level (which are folders of folders) should be alphabetical, then the folder with files I'd like to sort by date created. Now, all are presented in alphabetical order, and then I have to scroll down to get to them.
    Thanks!

    Nope, can't be done in Finder column view - alphabetical is the only option.
    You can submit a feature request here:
    http://www.apple.com/macosx/feedback/

  • Arrange Sort Files and Folders in CC Website

    Does anyone know how to arrange and/or sort files and collections in the Creative Cloud website?  I uploaded files, and they are currently listed there in the order they were updated.  I would like to sort them alphabetically with collections first then files.  How can I do this?  Thanks.

    Currently there is no functionality like you describe, but I agree that this would be really helpful.
    I created an idea/feature request for the functionality here, please add your vote and comments
    http://forums.adobe.com/ideas/1575
    Thanks,
    -Dave

  • Sorting files when combining pdfs?

    Ok, I'm not quite sure how adobe sorts files when combining pdfs, but it seems to be somehow different from MS XP.  Anyway, what I want to do is combine a bunch of pdfs together which are labelled A 1, A 2, A 3... However, I'm finding that when sorting them by name in adobe to combine them in the right order that the 1's, 2's, and 3's get grouped together, where they are then not sorted numerically.  For instance A 2 gets sorted with A 20 and A 200.  Even when I use MS XP to rename (e.g. A (1), A (2)) or use Adobe to extract files from a pdf the files are named in such a way that this always happens.  Anyway to get around this without manually sorting the files?
    A better example of what happens:
    A 1
    A 10
    A 11
    A 12
    A 13
    A 14
    A 15
    A 16
    A 17
    A 18
    A 19
    A 100
    A 2
    A 20
    A 21
    A 22
    A 23
    A 24
    A 25
    and so on and so forth... where I would like
    A 1
    A 2
    A 3
    A 4
    A 5...

    Looks like a lexicographic ("dictionary" or "telephone book,") order and not numeric order. You could add leading zeros to have all the file names have the same length.

  • How to sort file list by time

    I have saved many PDF files from my mails - when I want to open (Adobe Reader on Samsung tablet) the file last saved I have no possibility find it simply by sorting file list by time - (list is fixed by name only) - how to change list order?.

    Sorting by time could be based on documents'
    (a) Date/Time created
    (b) Date/Time modified
    (c) Date/Time last opened / accessed
    Adobe Reader for Android shows (c) in Recents.
    (Click the image above to enlarge)
    The last opened PDF document appears at the top.  Please note that it is not customizable - meaning that you (as a user) cannot change the sorting criteria.

  • Am I able to sort files by name in elements 11 organiser?

    Am I able to sort files by name in elements 11 organiser?

    Thanks, I'll give it a try, however, I now have Apple Aperture which gives me a very comprehensive 'filing & sorting system'.
    regards
    david

Maybe you are looking for

  • How to use different iViews for variables and queries?

    Hi all! I need to use separtate iViews for storing variables and extracting queries. For example, I have one variable "Currency" for two different queries,  and I need that all of these queries (in separate iViews) would use the value of currency was

  • JDBC sender adapter, ...Processing parameters, Update SQL statement

    in JDBC sender adapter, ...Processing parameters, there is an Update SQL statement field, can u tell me ...why this is required,,,,,and in one of the example scenario...it was given as <TEST>..

  • Bridge cs5 will not recognize cr2 files [mod edit: from the Canon 1DX]

    I just re-installed Photoshop CS5 to a new computer, but now I see that Bridge cannot preview CR2 raw files from my camera. Do I need a special plugin for this? Bridge worked fine on my old computer, but I can't remember what I did to see the preview

  • Skype credit issues

    Hi, I have an issue with my skype credit. Last week I did the payment to recharge my Skype credit. My Skype credit history says it was 'DELIVERED' however I didn't see any recharge in my account. I already checked the following link: https://support.

  • [SOLVED] Kernel 3.2.1 and USB Touchscreen Failure

    With the upgrade from linux 3.1.9 to 3.2.1, my touchscreen device is no longer recognised. Hoping someone may be able to shed some light on the situation. Here are my Xorg logs for both kernels: http://home.exetel.com.au/padfoot/logs/xorg.log.3.1.9 h