1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

DOS: Open Text File and have the Cursor @ the End of File

Discussion in 'General Programming Chat' started by NotGonnaTell, Aug 3, 2011.

  1. NotGonnaTell

    NotGonnaTell Newbie

    Joined:
    Jun 23, 2011
    Messages:
    1
    Likes Received:
    0
    Hi,

    Thank you for your help.

    Had to build a PC to use 'cuz My Old PC when "Ka-put!"

    So, Have to use Vista instead of XP.

    Vista does NOT allow (Well, THIS PC, at least) to use .LOG
    at the beginning of a Text file to Time and Date Stamp
    the file upon opening...

    SO, I wrote a Batch File to do this FOR Me,
    but, can't get the file to open w/ the Time and Date stamp,
    having the Cursor at the End of the File.

    I've attached the code here for the Example of what I'm doing.

    Any Ideas on what I'm doing wrong or what I'm missing?

    Thank You VERY MUCH for Your Help in Advance!

    Thanks!

    Code:
    ECHO %DATE% %TIME% >> FileName.txt
    
    START filename.txt &GOTO:EOF
    REM &GOTO:EOF and GOTO:EOF or GOTO EOF does not work
    
    
     
  2. Baybo.it

    Baybo.it Registered Member

    Joined:
    Aug 9, 2011
    Messages:
    72
    Likes Received:
    39
    Occupation:
    Founder of Baybo.it
    Location:
    San Francisco
    Home Page:
    Here is a correction to my original post. You can actually background the process by using /b instead of /min

    ---

    Are you trying to append the start time to the file, open it, and then detatch it?

    For example, over Linux you'd do:
    Code:
    $date >> testing123
    $gedit filename.txt & #assuming you'd use gedit (replace with emacs, vim, whatever)
    
    If my understanding is correct, you may want to do something like this:
    Code:
    ECHO %DATE &TIME& >> filename.txt
    START /min filename.txt
    
    However, what if the file has already been timestamped? You should probably check the first line of the file to make sure there isn't already a line which matches the DATE TIME pattern.

    I am not sure if I was entirely clear on your question, so if you have any more details, please let me know.