Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Beginning Java
how to get a character from a file ??
AJ Smith
Greenhorn
Posts: 7
posted 20 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
how can i get a charecter from a file one by one and i'd like to compare it with "a" , newbie here
Ernest Friedman-Hill
author and iconoclast
Posts: 24207
46
I like...
posted 20 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
This will get you started:
import java.io.*; class MyClass { publc static void main(String[] argv) { try { FileInputStream fis = new FileInputStream("filename.txt"); int c; while ((c = fis.read()) != -1) { if (c == 'a') { // Do something here! } } fis.close(); } catch (IOException ioe) { ioe.printStackTrace(); } } }
[Jess in Action]
[AskingGoodQuestions]
AJ Smith
Greenhorn
Posts: 7
posted 20 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thank you very much !
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
why are JAR files created
insert header and footer with POI HWPF?
How to know no of records resultset contains in xml file
Uploading File
How can i show backend table data in CSV format
More...