r/programmingrequests • • 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!

1 Upvotes

17 comments sorted by

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.

Can you clarify what happens when you enter a name into a field twice? Do just want the text file to be renamed?

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

Any more details or examples of how you would use it helps (e.g. a number list of steps, like what you would enter into each field and what you are expecting the output to be)

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

  1. All fields are blank, therefore all the textfiles are named Winners A etc but are empty
  2. I write the name "Numpty McButtButt" into the text field for Winners A, this then writes "Numpty McButtButt" to the textfile Labelled "Winners A.txt (Example would be if I ran cat Winners A.txt output would be Numpty McButtButt but if I ran cat Winners B.txt output would be nothing

however 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!

1

u/AutoModerator Jan 09 '21

Reminder, flair your post solved or not possible

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/immersiveGamer Jan 09 '21

Ah, I get it. So each text file will display the name you want on a certain location. Cool. Windows okay? Or does it need to run on Linux / Mac?

1

u/TheTrueSirRando Jan 09 '21

Windows is perfect thank you!

1

u/AutoModerator Jan 09 '21

This post was automatically marked as solved but you can manually change this.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.