Trouble converting serial data (string--> int)

Im trying to pass an array of int values from my Arduino to a processing sketch threw a serial link.
But I need to convert the data collected from the sketch to int values. And that’s where’s the problem
in the first case, it returns me 0 every time even if I change the value and in the other case it returns me an error. I can’t understand anything can you help me?

There is the code on the arduino !

int Rx = 7 , Ry = 5, Rz = 15, Tx = 89, Ty = 56, Tz = 75;
int coord[6] = {Rx, Ry, Rz, Tx, Ty, Tz};
void setup() {
  Serial.begin(9600);
}

void loop() {
  for (int i = 0; i < 6; i++) {
    Serial.println(coord[i]);
    Serial.println("/");
  }
  Serial.println("|");
}

and that’s the processing sketch.

import processing.serial.*;
Serial port; 
String myString;
int val;

void setup() {
  //size(1200,600);
  String portName = Serial.list()[1];
  port = new Serial(this, portName, 9600);
}
int Rx = 0, Ry = 0, Rz = 100, Tx = 0, Ty = 0, Tz = 0;
void draw() {
  if (0 < port.available()) {  
    myString = port.readStringUntil('|');     
    if (myString != null) {
        println(myString.split("/")[2]);
        val = int(myString.split("/")[2]);
        println(val);
    }
  }
}

the problem is that val is always equal to 0.

thank’s for your help and I’m sorry for my english.

Why don’t you convert them all to numbers?

import processing.serial.*;
Serial port;
String myString;
int val;

void setup() {
  //size(1200,600);
  String portName = Serial.list()[1];
  port = new Serial(this, portName, 9600);
}
int Rx = 0, Ry = 0, Rz = 100, Tx = 0, Ty = 0, Tz = 0;
void draw() {
  if (0 < port.available()) {  
    myString = port.readStringUntil('|');    
    if (myString != null) {
        int[] nums = int(split(myString, '/ '));
        val = nums[2]);
        println(val);
    }
  }
}

In our Arduino code, you want to use print(), not println() since that adds a newline ‘\n’ after each integer which may mess up your processing code (I don’t have that installed). The string you are sending is
“7\n/\n5\n/\n15\n/\n89\n/\n56\n/\n75\n/\n|\n”

but you should be sending
“7/5/15/89/56/75/|”

Well.
It works perfectly, thanks.
the problem was with the println().
Thanks, A lot, I was stuck on this for more than 3 hours.