0
I am facing the following problem by running the following commands on the terminal, java -jar logisim-filename.jar adder-test.circ -tty table
i get a table on the terminal itself, delimited by tabulations, as follows:
00 00 000
01 00 001
10 00 010 etc…
In my program I need these values, only I do not know how from the terminal (which command run) pick them up and transfer to my program so that I do the necessary, if someone can tell me if you have how to do.
Editing:
My program takes a file . txt and removes this data, as if it were data from a true table, only, reading the . txt ta being made that way:
public class tt2vcd {
public static void main(String[] args) throws IOException {
//Leitura do arquivo gerado pelo logisim
String fileName = args[0];
FileReader entrada = new FileReader(fileName);
BufferedReader entradaFormatada = new BufferedReader(entrada);
//Denominada uma String arquivo para manipular o nome do Arquivo do logisim
String arquivo = fileName;
//Trocado o tipo de arquivo, não sendo mais .txt, e sim .vcd
arquivo = arquivo.replace("txt","vcd");
//definida a leitura do arquivo caractere por caractere
int c = entradaFormatada.read();
//realiza o processo de gravação...
}}
So what I want to do is from the terminal, get this double treatment, using a tag, so when the guy generates the truth table in the terminal, I extract the information from the terminal, and when the guy wants to use the . txt I extract from . txt.
I’m using Windows but I have access to linux too.
Add the code to the question.
– user28595
What operating system do you use? I say this because, under Linux, for example, you can save the terminal output to a text file. Having this, it is easy for your program to access this file and do what you need to do.
– StatelessDev
If it is Linux you can do this: logisim-filename.jar Adder-test.Circ -tty table > sometext.txt This command will save a txt with terminal output, from this as Statelessdev said you can read the txt file.
– Viktor Hugo
Guys, thanks, I added the code to the question, but I think I’ll do what Statelessdev said, the program is already doing the treatment. txt in a good way, so I think it’s the way, using Windows, but I have access to Linux. Carlos Heuberger my program needs to do the treatment both by command line and by file, using a tag (for example), for differentiation. Thanks again guys
– rickxzx