So, the following code (This is in java btw) will read the text from the file you provide, process it, and if the line starts with C3/
, will print the line with the first 18 characters removed, and the white space on the beginning and end trimmed off. If the line does not start with C3/
then the line will be printed as is. (FYI this java code is probably faster than a batch file in terms of processing your enormous text file, which is why i recommended java in the first place :P)
import java.io.*;
public class ClassName{
public static void main(String args[])throws IOException{
PrintWriter file_out = new PrintWriter("OutputFileName.txt");
BufferedReader br = new BufferedReader(new FileReader("OriginalFileName.txt"));
String line, temp, out = "";
while((line = br.readLine()) != null){
temp = line.substring(0,3);
if(temp.equals("C3/")){
out = line.substring(18, line.length()).trim();
file_out.println(out);
}else{
file_out.println(line);
}
}
file_out.close();
}
}
Of course replace OutputFileName.txt
and OriginalFileName.txt
with your text files. To compile and run this you will need to install and setup JDK. To see how to do this, click here. You can also find numerous other tutorials on the web on how to setup and use JDK. After you setup JDK, save this code as ClassName.java
, compile it, and run it. Make sure that this program is saved in the same folder as your input/output files.
Note: Normally i wouldn't give out code like this but i was bored and was feeling nice :)
Also, i highly recommend you try to program in java a bit yourself. It's a very interesting and versatile language. If you have any other questions, feel free to let met know :D.
Example input:
Display menu window
C3/000E: E220 SEP #$20
C3/0010: C210 REP #$10
C3/0012: 20640B JSR $0B64
C3/0015: 20750B JSR $0B75
C3/0018: C220 REP #$20
C3/001A: A90001 LDA #$0100
Example output:
Display menu window
SEP #$20
REP #$10
JSR $0B64
JSR $0B75
REP #$20
LDA #$0100