Hi, is there a way to read in a file to give a string which is passed to the method without reading line by line? I need to read in something like this...

1 MLRLPTVFRQ MRPVSRVLAP HLTRAYAKDV KFGADARALM LQGVDLLADA
51 VAVTMGPKGR TVIIEQSWGS PKVTKDGVTV AKSIDLKDKY KNIGAKLVQD
101 VANNTNEEAG DGTTTATVLA RSIAKEGFEK ISKGANPVEI RRGVMLAVDA
151 VIAELKKQSK PVTTPEEIAQ VATISANGDK EIGNIISDAM KKVGRKGVIT
201 VKDGKTLNDE LEIIEGMKFD RGYISPYFIN TSKGQKCEFQ DAYVLLSEKK
251 ISSIQSIVPA LEIANAHRKP LVIIAEDVDG EALSTLVLNR LKVGLQVVAV
301 KAPGFGDNRK NQLKDMAIAT GGAVFGEEGL TLNLEDVQPH DLGKVGEVIV
351 TKDDAMLLKG KGDKAQIEKR IQEIIEQLDV TTSEYEKEKL NERLAKLSDG
401 VAVLKVGGTS DVEVNEKKDR VTDALNATRA AVEEGIVLGG GCALLRCIPA
451 LDSLTPANED QKIGIEIIKR TLKIPAMTIA KNAGVEGSLI VEKIMQSSSE
501 VGYDAMAGDF VNMVEKGIID PTKVVRTALL DAAGVASLLT TAEVVVTEIP
551 KEEKDPGMGA MGGMGGGMGG GMF

...as a continuous string. I have methods in my class which capitalise and remove numbers/spaces, but it seems to only be reading the first line (even when I put this in as user input). I'm thinking this is probably because of input.Readline() only reading the first line rather than a problem with the regex??

Many thanks :)

String txt = "";
while ((line_in = bufferedReader.readLine()) != null) {
txt = txt + line_in;
// Now you will handle txt, not the input
}

Hope this helps :)

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.