Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #10406
    thanksgod
    Participant

    Hi, Can anyone help me on “Sorting” please

    I need to sort some column like the following

    GHI-12514518    erg5124ws3      Expiry date:2011.03.30
    ABC-42512544   jkje39735k        Expiry date:2017.05.20
    DEF-02151451    a2j397hgjv       Expiry date:2015.04.11

    I’ve tried all the following mode
    Normal Mode
    CSV Mode
    TSV Mode

    Can I sort by “Column” not “Row”, eg. If I want to sort column 3, I should get the following result:

    GHI-12514518    erg5124ws3      Expiry date:2011.03.30
    DEF-02151451    a2j397hgjv       Expiry date:2015.04.11
    ABC-42512544   jkje39735k        Expiry date:2017.05.20

    If I want to sort column 2, I should get the following result:

    DEF-02151451    a2j397hgjv       Expiry date:2015.04.11
    GHI-12514518    erg5124ws3      Expiry date:2011.03.30
    ABC-42512544   jkje39735k        Expiry date:2017.05.20

    But All I get from using (OR not using) the highlight the column 2 or 3 using the “Sticky Vertical Mode”, the result is just the same as normal sorting “Sorting by row” or “Sorting by column 1”.

    ABC-42512544   jkje39735k        Expiry date:2017.05.20
    DEF-02151451    a2j397hgjv       Expiry date:2015.04.11
    GHI-12514518    erg5124ws3      Expiry date:2011.03.30

    Only method I do at the moment, is to copy all the texts and paste them in Microsoft Word, and then use its built in “Sorting Function” by selecting the column I need and then just copy the result back to EmEditor” = =”

    Is there any workaround for this problem using EmEditor itself? :-?

    Thank you so much

    #10407
    Stefan
    Participant

    You can sort by column in EmEditor
    while you are in “Separated Values” mode.

    1.)
    Therefor you have to delimiter your columns first by either
    * one tab (t) => TSV mode
    * one coma (,) => CSV mode
    * one own delimiter => DSV mode ( e.g. one “:” or “|” or “;” or one space ” ” or…)

    Hint: For your examples
    RegEx Search for three-or-more spaces
    and replace by an coma:
    Find: s{3,}
    Replace: ,
    [X] Use Regular Expressions
    Now you have CSV.

    2.)
    Next switch to delimiter mode via
    menu “Edit > Separated Values/Sort > selecting-your-mode”

    For your case use CSV if you have followed the s&r tip.

    Hint: you must seen some thin vertical lines.

    3.)
    Then click into an column and use an Sort mode.

    Explanation:
    CSV means “Coma Separate Value” and you
    must have an coma between your columns.
    There must be NO coma inside the column itself!

    TSV means “Tabulator Separated Value”
    and the same is valid as said for CSV.

    DSV means “Defined(by user) Separated Value”
    and you have to set the delimiter yourself
    e.g to ‘;’ or ‘|’ or something like that.
    To setup the DSV delimiter go to menu
    “Tools > Properties for X”
    and at the [File] tab
    set the “Delimiter [; ]”

    Since spaces can sophisticate the sorting
    be sure to have no, or at least the same
    amount of spaces around your delimiter.
    (Your example lines have uneven amount
    of spaces between the columns)

    Please note that you can also right click
    the ruler to get the “Separated Value” menu.

    HTH?

    For more read the help or visit
    http://www.emeditor.com/modules/feature1/rewrite/tc_35.html#csv
    http://www.emeditor.com/modules/tutorials4/index.php?id=35

    #10410
    thanksgod
    Participant

    Hi, Stefan

    OMG, how easy it is, so now I don’t have use Microsoft Word anymore!!!

    Thank you so much for your solution. It works Wonderfully!!!

    Cool Cool Cool :pint::pint::pint:

    Thank you sir!! :-D:-D:-D

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.