Community
    • Login

    numeri casuali

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 3 Posters 107 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Stefano BrovelliS
      Stefano Brovelli
      last edited by

      Ciao a tutti,
      vado subito alla domanda principale
      posso inserire in un testo formattato in colonne, una colonna con numeri casuali?
      ringrazio tutti per la collaborazione
      Ste

      Terry RT 1 Reply Last reply Reply Quote 0
      • Terry RT
        Terry R @Stefano Brovelli
        last edited by

        @Stefano-Brovelli
        Please consider posting in english, even if you also want to include your own language. Most members are well versed in english and this is also mentioned in one of the FAQ posts.

        Remember, it is you who wants an answer, so it makes sense to not put difficulties in front of those willing to help.

        Terry

        In this case I have used Google translate to get:

        Hi everyone,
        I’ll get straight to the main question.
        Can I insert a column with random numbers into a text formatted in columns?
        Thank you all for your help.

        Stefano BrovelliS 1 Reply Last reply Reply Quote 1
        • Stefano BrovelliS
          Stefano Brovelli @Terry R
          last edited by

          @Terry-R
          many Thanks
          sorry
          Stefano

          1 Reply Last reply Reply Quote 1
          • guy038G
            guy038
            last edited by guy038

            Hello, @stephano-brovelli and All,

            From wikipedia, for example, here is the list of the 20 most common surnames in England, which will be our INPUT text :

            Surname           Percentage
             Smith              1.26
             Jones              0.75
             Taylor             0.59
             Brown              0.56
             Williams           0.39
             Wilson             0.39
             Johnson            0.37
             Davies             0.34
             Robinson           0.32
             Wright             0.32
             Thompson           0.31
             Evans              0.30
             Walker             0.30
             White              0.30
             Roberts            0.28
             Green              0.28
             Hall               0.28
             Wood               0.27
             Jackson            0.27
             Clark              0.26
            

            So, let’s suppose you want to insert, a column of random numbers between the Surname and Percentage existing columns. Follow this road map :

            • First, determine the number of rows of your list : in our example we have 20 rows

            • After your list, create 20 consecutive empty lines

            • Move back to the beginning of these empty lines

            • Open the Column editor ( Alt + C )

              • Select the Number to Insert option

              • Chose 1 for each option and Zeros or Spaces for leading characters

              • Select the DEC format

              • Click on the OK button

            => Of course, you’ll get this simple list :

             1
             2
             3
             4
             5
             6
             7
             8
             9
            10
            11
            12
            13
            14
            15
            16
            17
            18
            19
            20
            
            • Move back to the beginning of that list of numbers

            • Do a normal selection of the lines ( from line 1 to line 20 )

            • Use the Edit > Line Operations > Randomize Line Order option

            => You’ll get, for instance, this kind of OUTPUT :

            9
            5
            20
            18
            19
            3
            7
            6
            17
            8
            16
            2
            14
            1
            4
            15
            10
            12
            11
            13
            
            • Move to the first number of this new list, at column 1

            • Hold down the Alt and Shift

            • Do a zero-width column selection of these 20 numbers, with successive hits on the Down arrow

            • Click two times on the Right arrow key, to select the complete numbers

            • Click on the Ctrl + C shortcut

            • Go to the beginning of your present list

            • Put the caret/cursor on the 15th column of the first line Smith

            • Click on the Ctrl + V shortcut

            => You should get your expected OUTPUT text, below :

            Surname           Percentage
             Smith         9      1.26
             Jones         5      0.75
             Taylor       20      0.59
             Brown        18      0.56
             Williams     19      0.39
             Wilson        3      0.39
             Johnson       7      0.37
             Davies        6      0.34
             Robinson     17      0.32
             Wright        8      0.32
             Thompson     16      0.31
             Evans         2      0.30
             Walker       14      0.30
             White         1      0.30
             Roberts       4      0.28
             Green        15      0.28
             Hall         10      0.28
             Wood         12      0.27
             Jackson      11      0.27
             Clark        13      0.26
            

            Best Regards,

            guy038

            Ciao, @stefano-brovelli e tutti,

            Da wikipedia, ad esempio, ecco la lista dei 20 cognomi più comuni in Inghilterra, che sarà il nostro testo INPUT :

            Cognome           Percentuale
             Smith              1.26
             Jones              0.75
             Taylor             0.59
             Brown              0.56
             Williams           0.39
             Wilson             0.39
             Johnson            0.37
             Davies             0.34
             Robinson           0.32
             Wright             0.32
             Thompson           0.31
             Evans              0.30
             Walker             0.30
             White              0.30
             Roberts            0.28
             Green              0.28
             Hall               0.28
             Wood               0.27
             Jackson            0.27
             Clark              0.26
            

            Supponiamo quindi di voler inserire una colonna di numeri casuali tra le colonne Cognome e Percentuale esistenti. Seguire questa tabella di marcia:

            • Per prima cosa, determinare il numero di riga dell’elenco: nel nostro esempio abbiamo 20 righe

            • Dopo l’elenco, creare 20 righe consecutive vuote.

            • Tornare all’inizio di queste righe vuote.

            • Aprire il Column editor ( Alt + C )

              • Selezionare l’opzione Numero da inserire.

              • Scegliere 1 per ogni opzione e Zeri o Spazi per i **caratteri di testa

              • Selezionare il formato DEC

              • Fare clic sul pulsante OK

            => Naturalmente, si otterrà questo semplice elenco:

             1
             2
             3
             4
             5
             6
             7
             8
             9
            10
            11
            12
            13
            14
            15
            16
            17
            18
            19
            20
            
            • Tornare all’inizio dell’elenco di numeri

            • Effettuare una selezione normale delle righe ( dalla riga 1 alla riga 20 )

            • Utilizzare l’opzione Modifica > Operazioni di riga > Randomizza ordine righe.

            => Si otterrà, per esempio, questo tipo di OUTPUT :

            9
            5
            20
            18
            19
            3
            7
            6
            17
            8
            16
            2
            14
            1
            4
            15
            10
            12
            11
            13
            
            • Passare al primo numero di questo nuovo elenco, alla colonna 1.

            • Tenere premuti i tasti Alt e Shift.

            • Eseguire una selezione a larghezza zero di colonna di questi 20 numeri, premendo successivamente la freccia Giù.

            • Fare clic due volte sul tasto freccia Destra per selezionare i numeri completi.

            • Fare clic sulla scorciatoia Ctrl + C

            • Andare all’inizio dell’elenco presente

            • Posizionare il cursore sulla 15° colonna della prima riga Smith

            • Cliccare sulla scorciatoia Ctrl + V

            => Dovreste ottenere il testo aspettato OUTPUT, qui sotto:

            Cognome             Percentuale
             Smith         9        1.26
             Jones         5        0.75
             Taylor       20        0.59
             Brown        18        0.56
             Williams     19        0.39
             Wilson        3        0.39
             Johnson       7        0.37
             Davies        6        0.34
             Robinson     17        0.32
             Wright        8        0.32
             Thompson     16        0.31
             Evans         2        0.30
             Walker       14        0.30
             White         1        0.30
             Roberts       4        0.28
             Green        15        0.28
             Hall         10        0.28
             Wood         12        0.27
             Jackson      11        0.27
             Clark        13        0.26
            

            Cordiali saluti,

            guy038

            Tradotto con DeepL.com (versione gratuita)

            1 Reply Last reply Reply Quote 1
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors