• Products
    • Isadora
    • Get It
    • ADD-ONS
    • IzzyCast
    • Get It
  • Forum
  • Help
  • Werkstatt
  • Newsletter
  • Impressum
  • Dsgvo
  • Press
  • Isadora
  • Get It
  • ADD-ONS
  • IzzyCast
  • Get It
  • Press
  • Dsgvo
  • Impressum

Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags

    [ANSWERED] Random Accessing Text through Data Array

    How To... ?
    2
    3
    147
    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.
    • montana
      montana last edited by Woland

      I have  a couple of thousand word text that I want to pull in and randomly access individual words. I'm trying to figure out how the data array actor works and if that is the best method. Watched the Guru session, and it seems I should be able to what I'm trying to there but have been running into the basic problem of making an Excel file that will separate the words into individual cells in Excel (did that by doing text into columns/space) but then the file needs to be exported as Tab Delimited, and looking more closely it seems that the final file needs to be in a .txt format? which I'm stymied by as well. So perhaps there is a post out there already on how to do this, or if if another actor set-up would work better if I could be directed there? Thanks much.

      Michael R. Murphy
      MacBook Pro (14-inch, 2021)/Apple M1 Max/64 GB RAM
      iMac 2019/ Processor 3.8 GHz 8-Core intel Core i9/ Memory: 64 GB/ Graphics: Radeon Pro Vega 48 8 GB
      Mac Mini Apple M2 Pro with 10‑core CPU, 16-core GPU, 16‑core Neural Engine

      Woland 1 Reply Last reply Reply Quote 0
      • Woland
        Woland Tech Staff @montana last edited by Woland

        @montana said:

        I have  a couple of thousand word text that I want to pull in and randomly access individual words. I'm trying to figure out how the data array actor works and if that is the best method. 

        The best method depends on how random you want to be. Do you want a completely random word from anywhere in the file? Do you want to allow repeats? (If you don't want repeats, the Shuffle actor will be helpful.)

        Personally, I'd pull in the entire text with a File Reader or Read Text From File actor, then use Javascript to find out how many words are in the file, feed that max number into a Shuffle actor so I could use the Shuffle actor for randomization, then use Javascript again to take the number from the Shuffle actor and use it to select a the corresponding word from the text. If you literally just have a text file and want to be able to hit a trigger and get a random word from it, that's dead easy (if you have the right Javascript User Actors).

        File download for all of the Scenes in the screenshots below: select-random-word-2025-01-27-4.0.7.izz

        Read Text From File:


        File Reader (I prefer Read Text From File because of the greater degree of control it offers, but File Reader is much simpler):


        Data Array can work, but it's just a bit trickier since you need to hardcode some logic to deal with the dynamic nature of randomized text (blank text, allowing the same slot to be used twice in a row, etc.)



        @montana said:

        it seems I should be able to what I'm trying to there but have been running into the basic problem of making an Excel file that will separate the words into individual cells in Excel (did that by doing text into columns/space) but then the file needs to be exported as Tab Delimited, and looking more closely it seems that the final file needs to be in a .txt format? which I'm stymied by as well.

        If you go into Excel and do File > Save As > File Format > Specialty Formats, one of the options is a text file that's tab-delimited. Excel and do File > Save As > File Format > Specialty Formats, one of the options is a text file that's tab-delimited.



        @montana 

        So perhaps there is a post out there already on how to do this, or if if another actor set-up would work better if I could be directed there?

        There might be other posts if you search "random text", "random string", or "random", but the frontrunner actors are File Reader (but you'll need some Javascript), Read Text from File (but you'll need some Javascript), Data Array (a bit trickier, but do-able), and of course there's also the Pythoner actor (but for that you either need to be able to write Python code or be very patient with an machine learning tool like ChatGPT.)

        TroikaTronix Technical Support
        New Support Ticket: https://support.troikatronix.com/support/tickets/new
        Support Policy: https://support.troikatronix.com/support/solutions/articles/13000064762
        Add-Ons: https://troikatronix.com/add-ons/ & https://troikatronix.com/add-ons/?u=woland
        Professional Services: https://support.troikatronix.com/support/solutions/articles/13000109444

        | Isadora Version: all of them | Mac Pro (Late 2013), macOS 10.14.6, 3.5GHz 6-core, 1TB SSD, 64GB RAM, Dual AMD FirePro D700s |

        1 Reply Last reply Reply Quote 1
        • montana
          montana last edited by

          Thanks as ever for your prompt and thorough feedback!  Read Text from File works fine for what I need. I'll get into the other two patches in the next days and see what they're about. All the best from Montana

          Michael R. Murphy
          MacBook Pro (14-inch, 2021)/Apple M1 Max/64 GB RAM
          iMac 2019/ Processor 3.8 GHz 8-Core intel Core i9/ Memory: 64 GB/ Graphics: Radeon Pro Vega 48 8 GB
          Mac Mini Apple M2 Pro with 10‑core CPU, 16-core GPU, 16‑core Neural Engine

          1 Reply Last reply Reply Quote 1
          • First post
            Last post