# Data from txt file

**URL:** <https://discourse.processing.org/t/data-from-txt-file/11764>\
**Category:** Coding Questions\
**Created:** [June 1, 2019, 10:53pm UTC](https://discourse.processing.org/t/data-from-txt-file/11764 "2019-06-01T22:53:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![GuilhermeVolker](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/guilhermevolker/32/5657_2.png) [@GuilhermeVolker](https://discourse.processing.org/u/GuilhermeVolker)\
**Post date:** [June 1, 2019, 10:53pm UTC](https://discourse.processing.org/t/data-from-txt-file/11764/1 "2019-06-01T22:53:36Z")

</div>

I have to read a file with 4000 lines or more, when i run this code the sketch reads something near to 500 lines only. Is there some kind of limitation? i’d try with double variables too but didan’t work.

```auto
//global variables
String[] str;
float[] pressao = new float [100000];
float[] alt = new float [100000];
float[] pitch=new float [100000];
float[] roll=new float [100000];

void setup(){
  str = loadStrings("data/DATA.TXT");
  
  String[] arry = new String[str.length];

  for (int i=0; i < arry.length; i++) {
    String[] thisLine = split(str[i] , " " );
    
    pressao[i] = float (trim(thisLine[0]));
    alt[i] = float (trim(thisLine[1]));
    pitch[i] = float(trim(thisLine[2]));
    roll[i] = float(trim(thisLine[3]));
    
  print("pressão: "+pressao[i]);
  print(" | altitude: "+alt[i]);
  print(" | pitch: "+pitch[i]);
  println(" | roll: "+ roll[i]);
  }
}

```

the file its like that:  
1016.25 3082.09 -18.17 14.89  
1016.26 3082.14 -18.04 15.06  
1016.26 3082.14 -18.00 15.00  
1016.26 3082.14 -18.29 14.76  
1016.26 3082.14 -18.23 15.32  
1016.26 3082.14 -18.25 15.18  
1016.26 3082.14 -18.03 15.15  
1016.26 3082.14 -18.06 15.13  
1016.26 3082.14 -18.15 15.09  
1016.26 3082.14 -18.08 14.86  
1016.26 3082.14 -18.15 15.20  
1016.26 3082.14 -18.12 14.94

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [June 1, 2019, 11:14pm UTC](https://discourse.processing.org/t/data-from-txt-file/11764/2 "2019-06-01T23:14:53Z")

</div>

Much probably the problem is that the PDE’s console is limited. 💩  
That is, you end up seeing the last 500 hundred values logged by your **print()** commands. 🙈  
But rest assured, your arrays grabbed everything. 😌

---

<div class="post-metadata">

**Author:** ![GuilhermeVolker](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/guilhermevolker/32/5657_2.png) [@GuilhermeVolker](https://discourse.processing.org/u/GuilhermeVolker)\
**Post date:** [June 1, 2019, 11:21pm UTC](https://discourse.processing.org/t/data-from-txt-file/11764/3 "2019-06-01T23:21:52Z")

</div>

Nice to know! thanks 😁

---

<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:** [June 2, 2019, 5:27am UTC](https://discourse.processing.org/t/data-from-txt-file/11764/4 "2019-06-02T05:27:08Z")

</div>

Instead of println you can write in an array and save it as a logfile with saveStrings()
