Tom Breuer

Greenhorn
+ Follow
since Jun 21, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Tom Breuer

How come you guys dont just change the code so when someone is creating an account they can only use a first and last name...50% of the posts here are cindy glass asking someone to change their name..
20 years ago
you should change your name...cause cindy glass is gonna come get you...half the doggone posts on this site are about changing your name...youd think by now they would just write the code to incorporate their naming rules by now...it would save so many of those ....well say Sharp...please change your name posts....
20 years ago
I am a newbie but I want to write a simple program that goes into a specific directory and counts how many files exist in that directory and run some kind of method on each file to see if the specific string 'ELEMENTARY SCHOOL TEACHERS' is in each one if not return something to let me know which ones are missing it.. Thanks alot tb
20 years ago
hmm, i dont understand the method decaralation parts either
20 years ago
what do the switches actually do in /c /k ? Im thinking of the using Runtime.getRuntime().exec("cmd /K del File1.txt");
or Runtime.getRuntime().exec("cmd /K start fileMover.bat");
20 years ago
awesome reply, - never used a vector before, I was contemplating putting the last line of the File1 in a StringBuffer and comparing that one line to the second file, but your idea makes perfect sense. Now all I need to do is figure out some Runtime method to move the two original files to another directory using system commands for NT. like maybe run a .bat file. Anyway Thanks. TB
[This message has been edited by Tom Breuer (edited June 24, 2001).]
20 years ago
problem sounds similar to mine, i have 3 files in the directory, file1, file2 and new.txt i need to delete files 1/2 and then rename new.txt file1.txt, should i try to run a batch file to carry out the task or what? runtime.. ?
20 years ago
I have two files that need to be made into one file. The thing is file 1 has records A,B,C,D E and File 2 has records C,D,E,F,G,H. So now my program writes the final record as A,B,C,D,E,C,D,E,F,G,H.(some duplicate records) How can I get the file to just write the built file as ABCDEFGH.(each record is a line long) here is the program so far but I am confused about the compare part. any help would be great
import java.io.*;
import java.util.*;
public class MergeFile {
public static void main(String[] args) throws Exception {
File f1 = new File("C:\\Downloaded\\File.001");
File f2 = new File("C:\\Downloaded\\File.002");
File outFile = new File("C:\\Downloaded\\builtfile.001");
FileWriter outFlWr= new FileWriter(outFile);
BufferedWriter bufOutput = new BufferedWriter(outFlWr);
if(f1.exists() && f2.exists()) {
System.out.println("yes there are two files");
try {
FileReader inFlRd = new FileReader(f1);
BufferedReader bufInput = new BufferedReader(inFlRd);
String line;
line = bufInput.readLine();
while (line != null) {
bufOutput.write(line, 0, line.length());
bufOutput.newLine();
line = bufInput.readLine();
}//end while
bufInput.close();
}//end try
catch (IOException e) {
e.printStackTrace();
}
try {
FileReader inFlRd2 = new FileReader(f2);
BufferedReader bufInput = new BufferedReader(inFlRd2);
String line;
line = bufInput.readLine();
while (line != null) {
bufOutput.write(line, 0, line.length());
bufOutput.newLine();
line = bufInput.readLine();
}//end while
bufInput.close();
bufOutput.close();
}//end try
catch (IOException e) {
e.printStackTrace();
}
}//end if
else {
System.out.println("Process ran ran normal, only one PunchFile exists");
}
}//end main
}//end class

[This message has been edited by Tom Breuer (edited June 21, 2001).]
20 years ago
I have two files that need to be made into one file. The thing is file 1 has records A,B,C,D E and File 2 has records C,D,E,F,G,H. So now my program writes the final record as A,B,C,D,E,C,D,E,F,G,H.(some duplicate records) How can I get the file to just write the built file as ABCDEFGH.(each record is a line long) here is the program so far but I am confused about the compare part. any help would be great
import java.io.*;
import java.util.*;
public class MergeFile {
public static void main(String[] args) throws Exception {
File f1 = new File("C:\\Downloaded\\File.001");
File f2 = new File("C:\\Downloaded\\File.002");
File outFile = new File("C:\\Downloaded\\builtfile.001");
FileWriter outFlWr= new FileWriter(outFile);
BufferedWriter bufOutput = new BufferedWriter(outFlWr);
if(f1.exists() && f2.exists()) {
System.out.println("yes there are two files");
try {
FileReader inFlRd = new FileReader(f1);
BufferedReader bufInput = new BufferedReader(inFlRd);
String line;
line = bufInput.readLine();
while (line != null) {
bufOutput.write(line, 0, line.length());
bufOutput.newLine();
line = bufInput.readLine();
}//end while
bufInput.close();
}//end try
catch (IOException e) {
e.printStackTrace();
}
try {
FileReader inFlRd2 = new FileReader(f2);
BufferedReader bufInput = new BufferedReader(inFlRd2);
String line;
line = bufInput.readLine();
while (line != null) {
bufOutput.write(line, 0, line.length());
bufOutput.newLine();
line = bufInput.readLine();
}//end while
bufInput.close();
bufOutput.close();
}//end try
catch (IOException e) {
e.printStackTrace();
}
}//end if
else {
System.out.println("Process ran ran normal, only one PunchFile exists");
}
}//end main
}//end class

[This message has been edited by Tom Breuer (edited June 21, 2001).]
20 years ago