Monday, November 18, 2019

Java_Lesson(6) Writing to a File

Today I will work on writing to file, that is,
adding text to a file programatically. For comparison,
I will first do this from the Windows Command Prompt.

First, I want to create a folder on the desk top. i navigate
to the Desktop with the cd command, and use mkdir to
create the folder and give it a name.



Next, I want to write to a text file within it. I could ask cmd to open
NotePad with the .exe command, but I will write directly. So I
echo the text I want to enter and using >create the text in Notepad
called Weight.txt. Had the latter already existed in MyDaily , I would have
overwritten in it.


It's Monday the 11 and I want to make a new entry. Using @ before echo
creates a new line. Double arrow, >>; adds the text rather than overwriting.


Need to do this from Java next... Why!? Because I can then create arrays
and enter data.

                                                      *     *     *


*     *     *
Been lax on sugar. A weekly report from MyFitnessPal on sugar:

*     *     *







No comments: