# Newbie - connecting txt file to this code

**URL:** <https://discourse.processing.org/t/newbie-connecting-txt-file-to-this-code/8284>\
**Category:** Coding Questions\
**Created:** [February 11, 2019, 6:05am UTC](https://discourse.processing.org/t/newbie-connecting-txt-file-to-this-code/8284 "2019-02-11T06:05:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rezaniik](https://avatars.discourse-cdn.com/v4/letter/r/7c8e57/32.png) [@rezaniik](https://discourse.processing.org/u/rezaniik)\
**Post date:** [February 11, 2019, 6:05am UTC](https://discourse.processing.org/t/newbie-connecting-txt-file-to-this-code/8284/1 "2019-02-11T06:05:09Z")

</div>

hi all,

i am extremely new to processing, as of a few hours. perhaps i’m jumping too quickly and trying to do something more complex without know the basics but I have been messing around with the code below. And what I want to do is use a txt file with about 121 sentences of different definitions of “architecture” as the input for this visualization. I’ve tried a few ways to incorporate loadStrings without any luck… any advice on how to incorporate it into this existing code?

Thank you in advance!

```auto
public void setup() {
  frameRate(2);
  size(3000, 2000, P2D);
  fill(255);
}
  
public void draw() {    
  background(0);
  for (int i = 0; i < 1000; i++) {
    float x = random(width);
    float y = random(height);
    text("WHAT IS ARCHITECTURE?", x, y);
    text("Architecture is definitely a political act. - Peter Eisenman", x, y);
    
  }
  if (frameCount % 10 == 0) println(frameRate);
}

```

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [February 11, 2019, 8:12am UTC](https://discourse.processing.org/t/newbie-connecting-txt-file-to-this-code/8284/2 "2019-02-11T08:12:58Z")

</div>

loadStrings fills an array (which is a list)

declare list before setup()

String[] list1=loadStrings…

There is a tutorial on arrays but you want

text(list1[int(random(list1.length))], …

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [February 11, 2019, 8:15am UTC](https://discourse.processing.org/t/newbie-connecting-txt-file-to-this-code/8284/3 "2019-02-11T08:15:03Z")

</div>

This will give you a flickering text so you can reduce frameRate OR store the index of the array (the int… part) in an int variable and also x,y Position and Update those 3 when frameCount is % 110 ==0 or so

---

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [February 11, 2019, 3:34pm UTC](https://discourse.processing.org/t/newbie-connecting-txt-file-to-this-code/8284/4 "2019-02-11T15:34:01Z")

</div>

Hey,

Welcome to the community. 🙂  
You can format your code by :

- Pressing `Ctrl+T` in the Processing IDE code editor.
- Using the button `</>` in the message editor on this forum.
