Text() don't recognize \t tabulator

how about this example:
Storing String Data in Arrays? ?
sorry that code is for a file with a header line,
and contains a cell editor you might not need

anyhow you never tell us where you get that data file from,
can it be created as

  • CSV ( “,” separator ) and also named .csv
  • have a meaningful header line

once the data are in a table ( array ) the output for swap rows / columns
should be more easy.

Table datos; 

void setup() {
  size(500,500);
  datos = loadTable("data/Datos.txt", "tsv"); 
//}

// void draw() {
  background(0);
  for (int r = 0;r < datos.getRowCount() ; r++)   for (int c =0;c < datos.getColumnCount() ; c++)    text(datos.getString(r,c),10+c*60,(r+1)*20);
//  for (int r = 0;r < datos.getColumnCount() ; r++)   for (int c =0;c < datos.getRowCount() ; c++)    text(datos.getString(c,r),10+c*70,(r+1)*20);

}


1 Like