Hi All

I really need help in this. Im supposed to "extract" information from text files .

the text files looks somethings like this:

MODEL 1
ATOM 1 N SER A 253 -19.559 -25.512 -41.130 1.00 0.00 N
ATOM 2 CA SER A 253 -18.749 -26.500 -41.895 1.00 0.00 C
ATOM 3 C SER A 253 -17.587 -26.979 -41.032 1.00 0.00 C
ATOM 4 O SER A 253 -16.504 -27.273 -41.538 1.00 0.00 O
ATOM 5 CB SER A 253 -18.218 -25.843 -43.167 1.00 0.00 C
ATOM 6 OG SER A 253 -17.271 -24.841 -42.819 1.00 0.00 O
ATOM 7 H1 SER A 253 -18.928 -24.906 -40.567 1.00 0.00 H
ATOM 8 H2 SER A 253 -20.212 -26.016 -40.494 1.00 0.00 H
ENDMDL
MASTER 141 0 0 9 0 0 0 6 1137 1 0 12
END


Im supposed to extract the parts where the first word is ATOM and also when the last column is not H. Would be great if anyone could shed some light on this.Your help will be much appreciated!

As I have told someone else (you I believe) use a BufferedReader, while, reader.readLine, string.startsWith, and string.endWith.

Give that a try and post the code, if it "doesn't work", with a complete description of the difference between expected and actual results, along with any and all compiler/error messages.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.