Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #23819

    In CSV mode, we have already had some “sort” options, such as from A-Z, from Z-A, according to length of the string……But may I know if there’s a way to sort data randomly? Thanks!

    Yutaka Emura

    I just want to clarify. By “random sort”, do you mean shuffle lines (or cells) randomly? Then we will think about that in the future.


    Yes, I means “shuffle lines randomly”. I know a tool “Sublime Text” has this function.

    Mr KT

    Hey David,
    I currently shuffle selected text using this macro. Hopefully does what you need or can be adapted fairly easily.

    if (document.CellMode == true ) {
    document.CellMode = false;

    if( document.selection.IsEmpty ){
    // nothing is selected
    alert( “Select the text you want to shuffle\r\nIf this is a delimited file, select all text” );
    else {
    strSelText = document.selection.Text;
    strLinebreak = “\r\n”;
    arrLinesArray = strSelText.split(strLinebreak);
    arrLinesArray.sort(function random(){return 0.5 – Math.random()});
    arrOut = arrLinesArray.join(strLinebreak);
    document.selection.Text = arrOut;


    Hello,Mr KT! Your macro works very well on my computer. Thank you!

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