Reading FileInput data
Hi all, let's say we have a text file named "data1.txt" which contains 5 lines of random letters with no spaces.
I want to create a java program that reads the data in data1.txt and prints the length (number of letters on one line), the first 5 letters in data1.txt, and truncate those 5 letters to the first 3 letters and print those 3 letters on the output screen.
Basically, I just want a simple program that reads the data in a txt data file (with "File newone = new File("data1.txt");" ?) and manipulates what's read.
The java tutorials has a great little piece of File IO that includes how to read in a file and how to scan each element inside of that file.
Scanning and Reading a File
After learning how to get each element of a file it should be rather easy to figure out how to just print out the first three.