I have a certain set of data that has a very certain spacing that goes along with it. I was wondering if there would be anyway to scan that file with Java, check for any line that has two spaces before it and store that in an array. I’m not sure on how to check the lines to see if the line begins with two spaces verses anything else. And if it does I would like to store that string in an array like I said earlier. Any ideas are welcome.
Share
Read in a line from the file
Check the first two characters of that line for spaces
If there are two spaces, use a
StringTokenizerto split up the string into words, and store it in an array, or however you want to do it…