Question: I'm trying to read data from a .txt file. The format looks like this:

```
 ABC, John, 123
 DEF, Mark, 456
 GHI, Mary, 789

```

I am trying to get rid of the commas and put the data into an array or structure (structure most likely).

This is the code I used to to extract each item:

```
package prerequisiteChecker;

import java.util.*;
import java.io.*;

public class TestUnit {

    public static void main(String[]args){      
        try {
            FileInputStream fstream = new FileInputStream("courses.txt");
            DataInputStream in = new DataInputStream(fstream);
            BufferedReader br = new BufferedReader(new InputStreamReader(in));
            String strLine;

            while ((strLine = br.readLine()) != null) {
                String[] splitOut = strLine.split(", ");
                for (String token : splitOut)
                    System.out.println(token);
            }
            in.close();
        } catch (Exception e){
            System.err.println("Error: " + e.getMessage());
        }
    }

} 

```

At one point I had a print line in the "while" loop to see if the items would be split. They were. Now I'm just at a loss on what to do next. I'm trying to place each grouping into one structure. For example: ID - ABC. First Name - John. Room - 123.

I have a few books on Java at home and tried looking around the web. There is so much out there, and none of it seemed to lead me in the right direction.

Thanks.

Michael

Answer: 
Hitting a very similar sort of bug with 3.2.1 Facebook SDK. In my case, I get into FBSessionStateOpen but have been given an invalid access token. As the question states, the normal closeAndClearTokenInformation and even deleting the app doesn't fix it. The only way I have been able to get-back-in under this scenario is to have the user change their password in the setting app. So this is what I do.

```
// In my completion handler FBSessionStateOpen is called BUT an
// invalid accessToken was detected.

[session closeAndClearTokenInformation];
[FBSession renewSystemCredentials:^(ACAccountCredentialRenewResult result, 
                                    NSError *error) 
  {
     if (result == ACAccountCredentialRenewResultFailed ||
         result == ACAccountCredentialRenewResultRejected)
     {
       [self showErrorMessage:NSLocalizedString(@"You may need to re-enter your Facebook password in the iPhone Settings App.\n", nil)];
     }
     else 
     {
        // attempt opening a session again  (after they have updated their account 
        // settings I end up here)

        [self facebookLogin];  // Performs openActiveSessionWithReadPermissions, 
                               // but this time around the token issued should be good.
     }
 }];

```

This is the only pragmatic solution I have been able to come up with.
I think you need to get a new access token with code like this...

```
[FBSession.activeSession closeAndClearTokenInformation];
[[FBSession class] performSelector:@selector(renewSystemAuthorization)];
[FBSession openActiveSessionWithReadPermissions:nil
                               allowLoginUI:YES
                          completionHandler:^(FBSession *session, FBSessionState state, NSError *error) {

}

```