Reputation: 5545
The following is a line of huge .txt file and i am reading it line by line. I need the value of second column. In this line, I need to extract 'C9006'.
Mr ABC|C9006|The white field, ON|493-493-4939|493-493-4939|YR|Inactive
Note : The delimiter char is pipe sign '|'. The length of second column is not consistent.
Help please.
Upvotes: 0
Views: 695
Reputation: 20685
String value = "A|B|C";
String secondColumn = value.split("|")[1];
Upvotes: 3