-5

I have a text file which i would like to split. It looks like

Julie Resnekov#212#32#90#63.2#62.5
Nathan Sher#378#90#244#90.9#32.5
Jake Reich#772#663#333#67.0#72.0
David Cohen#78#278#67#78.8#72.2
Max Glanz#311#385#89#86.4#88.9
Aaron Burstein#309#112#366#89.5#34.5
Jordan Levin#245#322#90#88.8#85.5

I would like to split it along the hashtags and then get the split information.

Adheep
  • 1,585
  • 1
  • 14
  • 27

3 Answers3

1

If you are interested in learning something,

Following Steps will help you.

  • First of all Use BufferReader to read file
  • Read one line at time by the use of readLine() and store it to String
  • Now your String will have line i.eJulie Resnekov#212#32#90#63.2#62.5
  • Use split() method to split the String content by #
  • Now you will have array of String which is retrived after split.

Otherwise COPY+PASTE is the second option.

akash
  • 22,664
  • 11
  • 59
  • 87
0

Use split method

String string = "Julie Resnekov#212#32#90#63.2#62.5";
String[] parts = string.split("#");

for(String part : parts){
System.out.println(part);
}
LMK
  • 2,882
  • 5
  • 28
  • 52
0
String[] split = info.split("#");

In your case this would yield an array containing the name in split[0] and the numbers in the rest of the array.

Adam Yost
  • 3,616
  • 23
  • 36