r/programmingrequests • u/TheTrueSirRando • Jan 08 '21
need help A program that can update 20 Text Files
Hi all,
I could do with a program, I would like a GUI with text inputs and what is typed into the text input field updates a text file, each input would need to edit a separate text file.
I am trying to put something together so that I can stream a tournament and update the bracket (top 8) and use the text files as the names of the players, they will need to change as the bracket progresses, I have done it manually in the past but its a real ball ache
The fields would need to be:
Winners Semi A
Winners Semi B
Winners Semi C
Winners Semi D
Losers Semi A
Losers Semi B
Losers Semi C
Losers Semi D
Winners Final A
Winners Final B
Losers Quarters A
Losers Quarters B
Losers Quarters C
Losers Quarters D
Losers Semis A
Losers Semis B
Losers Final A
Losers Final B
Grand Final A
Grand Final B
So one program that edits 20 different txt files from 20 different text input fields within one program
Thanks all!
View all comments
Show parent comment
1
u/TheTrueSirRando Jan 09 '21
The text entries on the gui do not replace the name of the text files, but the content. OBS has a function where it will display the content of a read Text file, as soon as the file is updated it will change what is shown on stream. The name of the text files needs to stay the same so that OBS knows what to point at to read from.
whatever is entered into the GUI Text entry automatically deletes what is currently in the txt file and replaces it with what is in the GUI.
an Important edge case is that if there is nothing in the GUI text field on the program, the content of the appropriate text file is also empty
As OBS, the streaming software I use, can read directly from text files. If you look at *this* image https://www.udrop.com/4G8m/unknown.png that is the sort Of overall graphic I am trying to recreate, the names will changes as the stream goes on by OBS reading the content of the text files and displaying them as they are typed into the program
cat Winners A.txtoutput would beNumpty McButtButtbut if I rancat Winners B.txtoutput would be nothinghowever you see appropriate, either for the program to generate all the textfiles in its current directory, or it asking for me to add a directory path for the text files is fine
I would however like for this to be put up on github if possible, (your own if you have one) So I can have a look and try to learn how you have done it and bodge it later (see, copy and paste so there are more fields if i need a top 16 instead of a top 8)
Thank you for looking into this!