Posted June 6, 2005 by David Kirk in Windows

Notepad is one of Window’s best tools. As I frequently use it with logs, here are a couple of time and date tricks I have learned over the years.

Notepad is simple and full of little tricks. I use it for creating and using log files all the time. Here are a couple of ways to use Notepad to automatically insert the time and date. These techniques work for all versions of Microsoft Windows, including XP, Vista, and Windows 7.

Automatically insert a timestamp every time a file is opened:

A simple way to record what you are doing at certain times is with a .LOG file in Notepad. Using this method, each time you open and close Notepad, a timestamp is created to time your activities more efficiently. Simply open the document, record what you did, save the file, and then close it.

1. Open Notepad.
2. On the first line of the file, type this:
.LOG

3. Hit ENTER to insert one carriage return.
4. Save the file.

By doing this, every time you open the file in Notepad, a timestamp will be inserted.

How to use notepad to create a dated log or journal file

Insert Current Timestamp

If you are in any text document in Notepad and decide you need to add the current timestamp, just hit F5. The timestamp will automatically be created.

How to use notepad to create a dated log or journal file

Geoffrey_Carr

How to use notepad to create a dated log or journal file

Notepad telah menjadi editor teks standar yang disertakan dalam Windows selama bertahun-tahun, memungkinkan Anda untuk membuat dan mengedit file teks biasa. Tapi, tahukah Anda bahwa Anda juga dapat menggunakan Notepad untuk menyimpan catatan tanggal atau jurnal? Ini sangat mudah dan kami akan menunjukkan caranya.

Buka Notepad dan ketik .LOG di semua topi pada baris pertama dari file teks baru.

How to use notepad to create a dated log or journal file

Pilih “Save As” dari menu “File”.

How to use notepad to create a dated log or journal file

Arahkan ke folder tempat Anda ingin menyimpan log atau file jurnal Anda. Masukkan nama untuk file di kotak “Nama file” dan klik “Simpan”. Anda dapat memberikan nama file apa pun yang Anda inginkan.

How to use notepad to create a dated log or journal file

Waktu dan tanggal tidak ditambahkan ke file sampai Anda menutup dan membuka kembali file, jadi klik tombol “X” di sudut kanan atas jendela Notepad untuk menutupnya.

How to use notepad to create a dated log or journal file

Buka kembali file teks yang Anda simpan. Waktu dan tanggal dimasukkan secara otomatis, dan kursor diletakkan pada baris berikutnya yang siap untuk Anda mulai mengetikkan catatan masuk atau jurnal Anda. Simpan file ketika Anda selesai dan tutup Notepad.

How to use notepad to create a dated log or journal file

Saat berikutnya Anda membuka file lagi, waktu dan tanggal ditambahkan ke bagian akhir file. File Anda akan mulai tampak seperti gambar di awal artikel ini. Anda dapat memindahkan atau mengganti nama file dan tanggal dan waktu akan tetap disisipkan setiap kali Anda membuka file.

This tutorial will show you how to use a simple Windows Batch file and the task scheduler to create an automated daily backup. We will use the date variable to backup the files into folders with the first three letters of the day as the folder name.

First you will need to open notepad. The easiest way is going to start > run and typing notepad.
How to use notepad to create a dated log or journal file

We will use notepad to create are batch file. A windows batch file is a set of instructions that tells the computer what to do. All we really need to do is add the command to copy the folder that we want to backup. I have a folder called ‘test’ that I want to backup to a folder called ‘backup on a network drive which I have mapped as the x drive. It only takes one simple command to do that actual backup. (note: there is no | in the command next the the word date, that is just the cursors)
How to use notepad to create a dated log or journal file

Now I will explain the command “xcopy c:\test\* x:\backup\%date:

The xcopy commands will copy files and folders. The syntax for the command is xcopy [destination] [arguments]. Where source is the folder that you want to backup and destination is the backup on the network drive. The arguments tell xcopy how to handle certain situations. For my script I used /Y to suppress prompting when overwriting files. If you do not include this the script will ask you before copying each file, that wouldn’t be automated. /Q doesn’t display the file names while copying. /S copies directories and sub directories. You can find more arguments by opening the command windows and typing xcopy /?.

Where you see \%date:

0,3%\ is the name of the destination folder. If you didn’t want to change the name daily you could simple call it \backup\ or something like that. The %date% is a variable. If you type %date at the command line, you will get the current date and time output. The :

0,3 tells the command line to return the first three letters of that date (0-3) and trim off the rest.

Once you have made the changes that you nee, save the file as backup.bat
How to use notepad to create a dated log or journal file

Now Open the Control Panel and select Scheduled Tasks
How to use notepad to create a dated log or journal file

Now we want to add a new task so click the “Add Scheduled Task” button.
How to use notepad to create a dated log or journal file

Click next and then browse. Locate the backup script you just saved and click open.
How to use notepad to create a dated log or journal file

Select perform this action daily and then click the next button.
How to use notepad to create a dated log or journal file

Select enter the time you want the task to run at in the start time box. Then make sure daily is selected and change the date to the day you would like this task to start running on.
How to use notepad to create a dated log or journal file

Enter your password and click next. (note: if you do not have a password, you may have problems with the scheduled tasks running correctly. I recommend adding a password to your account, or setting up a separate account to run scripts.)
How to use notepad to create a dated log or journal file

Click finish. Now we can test the backup script. Located the script in the scheduled tasks folder, Right click it and select run.
How to use notepad to create a dated log or journal file

You should see the command window open. When the task is finished, browse to your backup folder and verify that the files have been copied.
How to use notepad to create a dated log or journal file

This is a very basic idea of how to use the task scheduler and batch files to make backups.

Johnathan Ward is an experienced developer and consultant that writes tutorials to help other developers. In his day job, he is an IBM Watson Consultant with several years of experience deploying and customizing Watson Explorer solutions.

This tutorial will help you to create files and directories with the name of current date time on Windows system. For example, you are writing a script which creates backup regularly, Now you want to organize daily backups with the current date and time name, so it will be easier to identify, which folder containers backups of which date. Go through the tutorial and understand how you can accomplish this.

Get Date & Time in Batch Script

Windows takes the date in the format like Thu 11/02/2017. Now below 3 set of commands extract the date in YYYY format, month in MM format and date in DD format and stored in CUR_YYYY, CUR_MM, and CUR_DD variables correspondingly.

Next is to parse the time which is available in 11:20:56.39 (Hours, Minutes, Seconds, and Micro Seconds) format. Now extract the hours, minutes, seconds, and microseconds and store them in variables.

Now, you have variables having current date and time in variables. You can use and create any file name as per your requirements like:

If your current date time is Nov 02, 2017 15:41:36, then the above example will create a file in the current directory with name “access_20170306-143822.log”.

A Sample Batch Script with Date & Time

The complete windows batch script will look like below. To test this create a file test.bat with the following content. Save the file and execute the script.

How to use notepad to create a dated log or journal file

You will see a directory is created with name 20171102-154136 and a file create in current directory with name access_20171102-154136.log (Filename will be according to current date and time and will change during your testing)

You can create a text file on your computer with a text editor. An example of a text editor is Notepad, which is included with Microsoft Windows.

When we refer to a “text file” we are talking about a plain text file without any text formatting (e.g., bold), images, different fonts, font sizes, etc. If you need to create a more rich document with any of these features see: How to create a document.

The below recommendations are for programs included with an operating system. You can also download and install a more powerful and free text editor such as Notepad++ to create, view, and edit text files.

  • Open and use Notepad.
  • Save the file as a text file.
  • Create a new text file from the desktop.
  • Create a text file from the Windows command line.
  • Create a text file from within a Linux shell.

Open and use Notepad

The easiest way to create a text file in Windows is to open up the Notepad software program on your computer. The Notepad is a text editor included with Microsoft Windows.

A text file is considered a plaintext file and Notepad is only capable of creating and editing plaintext files. Notepad saves any text file with a .txt file extension, which means no special formatting or fonts can be used.

The Windows Notepad program can be opened using either of the methods below.

  1. Click Start.
  2. In the Run or Search box, type Notepad and press Enter .
  1. Click Start.
  2. Open All Programs, Accessories, then click the Notepad shortcut.

Save the file as a text file

You can also create a text file using any other word processing software program, like Microsoft Word or WordPad. When saving the file, change the file name or file type to Plain Text to save it as a text file. In many of these programs, you also have the option to save the file as a Rich Text Format.

How to use notepad to create a dated log or journal file

After the file is created and saved, it can also be edited using Notepad or another word processing software program.

Create a new text file from the desktop

Another way to create a text file is to right-click an empty area on the desktop, and in the pop-up menu, select New, and then select Text Document.

Creating a text file this way opens your default text editor with a blank text file on your desktop. You can change the name of the file to anything you want. You can edit the file in the Notepad program or any other word processing software program, like Microsoft Word.

These same steps can be used in any other location on your computer, for example, another folder.

Create a text file from the Windows command line

While in the Windows command line, you also can create a new text file in the current directory. With earlier versions of Windows, a new file of any type, including text files, could be created using the edit command line command. Later versions of Windows removed the ability to use the edit command for this purpose. Instead, you can use the echo command at the Windows command line to create an empty text file in the current directory. An example of using this shown below.

In the example above, you are using the echo command to create a file named “myfile.txt” in the current directory. Note that there are no spaces between echo, the period, the greater-than sign (>), and the file name.

Another option for creating a text file from the command line is with the start command, as shown in the example below.

In this example, you are using the start command to open Notepad with the file “myfile.txt”. Assuming this file does not exist, it would be created and saved in your current directory. If the file did exist, you would be editing that file.

Create a text file from within a Linux shell

How to use notepad to create a dated log or journal file

Several commands can create a text file in a Linux shell. One easy-to-use text editor is pico. You can use it like this:

After entering the command above, the editor opens and allows you to create a text file. When done, press Ctrl + X to exit the file. When prompted to save the file, if you want to keep the file, press “Y” for yes.

The .txt file extension is not required in Linux. It is a file extension most commonly found and used with Windows. If you do not need the file to open in Windows, you can have no file extension or rename it to whatever you want.

How to use notepad to create a dated log or journal file

Nauman Mysorewala, BIM Manager

How to use notepad to create a dated log or journal file

  • 527 posts
  • 153 kudos
  • 36 solutions
  • 2 ideas

Report this article?

This is an abstract from a presentation at Autodesk University 2017

BLD125158 – Code Blue Dr Revit – How to Resuscitate Corrupt Revit Models presentation
Watch it at au.autodesk.com and get the datasets

Understanding Journal Files

Many operating systems and software applications have a method of logging messages, errors, output, etc. in file(s) typically referred to as Log files. These files are used to diagnose issues or making sure that the program is working correctly. These are typically plain TEXT files that can easily be opened in variety of software, like Notepad. Revit is no different in logging various information about the current Revit session and refers to these logs as Journals. Journals contain valuable information that can be used to help in troubleshooting various issues encountered with Revit performance, stability or Revit file health. However not officially supported anymore, these can also be used to perform automated scripting in Revit, especially in older version when there was no programming interface (API) was available. Journals provide insights into:

  • Revit Build/Version
  • Hardware details
    • Processor
    • Video card
    • Printers
  • Memory usage
  • User Name
  • Path to Central Model
  • Path to Server
  • Template Path
  • Timing information
  • Loaded plugins
  • Linked files
  • Commands issued
  • Results of various commands
  • Element borrowing and relinquish data. CENTRAL BORROWS
  • Sync command results
  • Elements created or modified
  • Debug messages
  • Diagnostic data

Journal files are located in the current users %LocalAppdata% folder. This folder also contains backups of families edited, non-workshared networked project backup file and other diagnostic files.

A Journal file is created for each session of Revit, and number increments i.e journal.0234.txt, journal.0235.txt. The highest numbered file, is for the last session loaded on the computer. Each version has its own Journal folder.

Autodesk’s article explains detailed information on where to find these files.

TIP: My favorite way to quickly access various Windows system folders is by typing %ENVIRONTMENT_VARIABLE% in the Windows (File) Explorer address bar or using the Run Command box by pressing Winkey+R Refer to this Technet article for more information on Environment variables. . Another way to find and check the Environment variables is to open a Command prompt and type SET . This will list all the variables and its assigned values. I use this trick to find out the current setting for Revit Server Accelerator settings, without opening up Revit, or if I wanted to check while Revit is busy with a Sync.

How to use notepad to create a dated log or journal file

2018

Build Version (Control Panel)

In this tutorial, I’m going to show you how to create a batch file to export SQL query results to a text file.

While this article focuses on SQL Server, you may want to check the following source that explains how to use Spool in Oracle to export your query results.

To start, I’ll review a simple example to demonstrate how to export SQL query results to a text file.

The Example

Let’s say that you have a database in SQL Server, where:

  • The database name is: TestDB
  • The table name is: dbo.Person
  • The dbo.Person contains the following data:
NameAgeCity
Jade20London
Mary119NY
Martin25London
Rob35Geneva
Maria42Paris
Jon28Toronto

The goal is to export the results of the following SQL query using a batch file:

This is the data that you’ll get when running the above query in SQL Server:

How to use notepad to create a dated log or journal file

Let’s now review the steps to export the SQL query results.

Steps to Create Batch File to Export SQL Query Results to a Text File

Step 1: Prepare the command to export the query results

You may use the following template to export the query results to a text file:

For our example:

  • The server name that I used is: RON\SQLEXPRESS
  • The database name is: TestDB
  • The query is: “select * from TestDB.dbo.Person
  • The Path to store the exported file\FileName.txt is: “C:\Users\Ron\Desktop\Export.txt”

So this is the code that I used for our example:

You’ll need to adjust the code to fit your server name, and any other parameter, such as your database name, and the location where the TXT file will be saved on your computer.

Later, I’ll further explain each component in the above command, just in case you need additional clarifications.

Step 2: Create the Batch file

Copy the above command into Notepad (after making the adjustment to your server name, export location, etc.)

This is how the Notepad looked like in my case:

You’ll then need to save the Notepad file with the suffix extension of “.bat”

Here, I chose to save the file as “export.bat

How to use notepad to create a dated log or journal file

Once you are done, click on the Save button, and a new batch file will be created at your specified location:

Step 3: Run the batch file

For the final step, double-click on your batch file, and a new TXT file with the query results will be created:

How to use notepad to create a dated log or journal file

Additional explanation about the components of the code

Now let’s look closer at each component of the code, so that you can adjust it to fit your parameters:

• sqlcmd is the command

-S stands for the server name that you connect in SQL Server. Here, my server name is RON\SQLEXPRESS

How to use notepad to create a dated log or journal file

• -d is the database name. For our example, the database name is TestDB

How to use notepad to create a dated log or journal file

• -E stands for trusted connection

• -Q is the place where you’ll need to put your query in quotations: “select * from TestDB.dbo.Person”

• -s is for the column separator. In our case, it is going to be comma “,”

• -o is the location where the file will be saved (as well as the type of file that will be saved at that location. In our case, it is a TXT file): “C:\Users\Ron\Desktop\Export.txt”

You may also find it useful to get a legend for the command sqlcmd by typing the following command in the Command Prompt:

Additional Resources

You just saw how to export SQL query results to a text File. This method would work when dealing with SQL server. Yet, if you’re dealing with Oracle, you may want to check the following tutorial that explains how to export SQL query results using Spool.

Batch files are indeed useful to work with. You may then want to visit the following tutorials that deal with Batch files:

Finally, you can read more about sqlcmd by visiting the sqlcmd utility documentation.

Windows Journal was removed from certain versions of the Windows operating system. This update lets users install Windows Journal on versions of Windows from which it was removed. This package replaces the previous version, and can be installed over it.

This update adds Windows Journal to applicable system installations. Before you install this update, see the Prerequisites section.

About this update

This update helps reduce the security risk of opening Windows Journal files. The update adds a message box that opens when Windows Journal tries to open a Journal Note (JNT) or Journal Template (JTP) file. The box displays the following message:

Journal files might contain security hazards. Open this Journal file only if you trust the source of the file. Continue opening file anyway?
The message box contains Yes, No, and Help option buttons for responding to the message. The default action is No. Both Yes and No options close the message box. Yes continues opening the file in Journal. No closes the message box without opening the file. Help opens a Knowledge Base article in your default browser that contains more details.

Note The message box appears when Windows Journal is asked to open a .jnt or .jtp file in any circumstances.

Known issues in this update

The Windows Journal application is only available for the following languages:

How to use notepad to create a dated log or journal file

Notepad è stato l’editor di testo standard incluso in Windows per molti anni, consentendo di creare e modificare file di testo normale. Ma, lo sapevi che puoi anche usare il Blocco note per mantenere un registro o un diario datato? È molto semplice e ti mostreremo come.

Apri Blocco note e digita .LOG in maiuscolo sulla prima riga del nuovo file di testo.

How to use notepad to create a dated log or journal file

Seleziona “Salva con nome” da ” File “menu.

How to use notepad to create a dated log or journal file

Passare alla cartella in cui si desidera salvare il registro o il file journal. Immettere un nome per il file nella casella “Nome file” e fare clic su “Salva”. È possibile assegnare al file qualsiasi nome desiderato.

How to use notepad to create a dated log or journal file

L’ora e la data non vengono aggiunte al file finché non si chiude e si riapre il file, quindi fare clic sul pulsante “X” nell’angolo in alto a destra della finestra del Blocco note per chiudi.

How to use notepad to create a dated log or journal file

Riapri il file di testo che hai salvato. L’ora e la data vengono immesse automaticamente e il cursore viene posizionato sulla riga successiva pronta per iniziare a digitare il registro o la voce del diario. Salva il file quando hai finito e chiudi Blocco note.

How to use notepad to create a dated log or journal file

La prossima volta che apri di nuovo il file, l’ora e la data vengono aggiunte alla fine del file. Il tuo file inizierà ad apparire come l’immagine all’inizio di questo articolo. È possibile spostare o rinominare il file e la data e l’ora verranno comunque inserite ogni volta che si apre il file.

How to use notepad to create a dated log or journal file

A volte è necessario conoscere la versione specifica di un programma che è stato installato senza il fastidio di aggiornamenti automatici o altri “problemi” “Intromettersi. C’è un modo semplice per farlo? Il post di Q & A di SuperUser di oggi aiuta un lettore a controllare la versione di Google Chrome senza problemi di aggiornamento.

How to use notepad to create a dated log or journal file

Se stai cercando un modo per estendere semplicemente la tua rete Wi-Fi, colza la tua rete Wi-Fi esistente su una LAN o creare un punto di accesso completamente nuovo, Netgear EX6100 può fare tutto. Continuate a leggere mentre mettiamo alla prova il multi-sfaccettato estensimetro a range ridotto. Cos’è EX6100?