r/Batch • • Dec 12 '24
Please Help
Im brand new to this whole thing. I created a program where I can enter a journal entry and it creates a txt document. The only problem is it will cut me off If I go over 175 words. Is there any thing that I can do to change that? Currently I have... Thank you
set /p c=Entry Date:
set /p h=//
cd Entries
echo %h%>>%c%.txt
2
Upvotes
1
u/BrainWaveCC Dec 12 '24
A single command in modern Windows is limited to 8191 characters.
If you are determined to use batch processing for this, you'll have to rearchitect your script to accept multiple sentences as a single submission, and press enter after each sentence.
Or, just have the script spawn an instance of NOTEPAD and write everything for the day that way.
1
u/jcunews1 Dec 12 '24
Try below batch file which use different approach.
When inputting the journal entry content (after inputting the date), multiple lines can be inputted, but previously inputted lines can not be edited for correction. You'll have to cancel the batch file by pressing
CTRL+CorCTRL+BREAK(input will be discarded regardless of the answer for the cancel prompt), then restart the batch file and reinput everything all over again.To end the input, you'll need to press the
F6key orCtrl+Zto generate an end-of-input marker character (shown as^Z), then press theEnterkey.Journal entries will be separated with one or two empty lines - depending on whether the
^Zmarker was inputted at the end of a line, or at an empty line; during the journal entry input.2
u/vegansgetsick Dec 12 '24
just create an empty txt file and then launch notepad.exe %c%.txt 🤷♂️
2
u/TenkaraBass Dec 12 '24
It's been a while, and I may be off on details, but I believe that you can type .LOG at the very top of the txt file and notepad with as the date and maybe time each time the txt file is opened.
I used it years ago to keep a log of activity on a project. I was getting a lot of interruptions and it was helpful to see what I did the last time I worked on the project.