Please note that you can see the most current information for this User Tip in our new user community area
- http://my.noteworthysoftware.com/?topic=3824 -

Making a catalog of your NWC files

View the tip source
User Tip #: 140
Offered By: NoteWorthy Online on 2003-11-21 11:43:22
Last Modified: 2004-10-28 16:29:06

Do you have a large collection of NWC files on your computer? If so, you might want to try this tip for making a catalog of all of your NWC files.

The NWCINFO Tool:
The NWCINFO program is a console mode tool that can be used to extract information about NWC files. NWCINFO is available from the NWC downloads page. It is provided in a compressed ZIP package, so you have to manually extract its contents into a folder on your hard drive. In order to make it easier to work with console programs, a short folder location is recommended, such as C:\BIN. The rest of this tip assumes that you have extracted the NWCINFO tool into the C:\BIN folder of your hard drive.

Your NWC Collection:
If you have not already done so, now would be a good time to establish a separate location for your NWC collection. It is always a good idea to keep your files separate from your computer's application/program files. This makes it easy to find and backup all of your documents/files, without having to also backup all of your programs. In this tip, we assume that all of your personal documents, including NWC files, are located in a subfolder on your computer called C:\MyFiles.

Creating a NWC Song Catalog:

Starting a Console Session: The best way to work with the NWCINFO program is by opening a console from within Windows. Unfortunately, the best way to do this will sometimes depend on what version of Windows is installed on your computer. Start by looking in your Accessories section of the Start menu: Start -> Programs -> Accessories -> Command Prompt. If you do not see this command, look for an entry titled MS-DOS Prompt in the Start menu. If neither of these are present, try using the Start -> Run command. For Windows 95, 98, and ME, type Command the run box. For Windows 2000 and XP, type Cmd in the run box.

Building a Catalog: From the open console window, it is now possible to invoke a single command that will create your NWC file catalog, complete with the name of the NWC file, followed by its title and author. First, we should change our current working directory to the base location of all of our personal documents. We do this with the change directory (CD) command:

CD "C:\MyFiles"

Hint: The quotes are only really necessary if your actual folder name includes spaces. If your folder name includes spaces, simply quote the folder name whenever you use it in a command line.

Now, we create our NWC catalog by piping the result of a directory listing into the NWCINFO command, and saving the output into a catalog file:

dir /b /s *.nwc | "C:\BIN\NWCINFO" /list > NWC_Catalog.TSV

How does this command work? The "dir /b /s *.nwc" command lists all NWC files that are found within the MyFiles folder and any folders within the MyFiles folder. The vertical bar "|" is used to direct the output to the next command. The "C:\BIN\NWCINFO /list" command then reads the directory listing of NWC files, and then outputs a series of tab separated values (TSV) that make up your NWC catalog. The greater than sign ">" is used to direct the final output into a file named "NWC_Catalog.TSV". Each line in the TSV file describes one of your NWC files. There are three fields on each line. The first is the name of the NWC file, the second is the title of the song, and the last field is the author, as identified from File Info in NWC.

Browsing Your Catalog: Although you can view your TSV catalog with any text editor, it is easier to work with the results in a spreadsheet or database program. You might even have an appropriate viewer for your TSV file already installed on your computer. From the same console window, enter the following:

Start NWC_Catalog.TSV

This tells Windows that you want to view your new NWC catalog. A program suitable for viewing your catalog might open automatically. If it does not, you should try selecting either a spreadsheet or database program from the Open With box that appears. From within the viewer, you now can use the search and sort facilities of the viewer program to find and analyze portions of your NWC file collection.

Closing the Console Window: The best way to close the console window is by using the exit command. Congratulations, you have now mastered the art of using the command line within Windows.

See also:


User Comments


From: Marsu
When: 5 Years Ago

...and even mastered advanced art of DOS command line!
Thanks for the new /list option of NWCINFO.EXE :-)

If you're at ease with the tip above, you may want to go further. Ready?

If you have NWC files in many directories and not only in (sub)directories of C:\MyFiles, then you could do the following command (from any directory):

dir /b /s C:\*.nwc | "C:\BIN\NWCINFO" /list > C:\MyFiles\NWC_Catalog.TSV
(compare with previous command).
Of course, the C:\MyFiles directory should be replaced by the name you want, and must already exist. If omitted, the .TSV file will be placed in the current directory.

You can repeat this with all your disk drives (C:, D:, ...), in that case the ">" sign should become ">>" if you want to add (concatenate) the results to the previous ones:
dir /b /s C:\*.nwc | "C:\BIN\NWCINFO" /list > C:\MyFiles\NWC_Catalog.TSV
dir /b /s D:\*.nwc | "C:\BIN\NWCINFO" /list >> C:\MyFiles\NWC_Catalog.TSV
and so on.

If you're still at ease with all of this, you may want to look at the for form too to simplify the disk drives names, but this becomes more advanced DOS command!)


From: Ertugrul iNANĒ
When: 4 Years Ago

-
Batch commands (for %n in...) and batch files, even batch commands in batch files can be involved. ;)

In that case, replace the > (greater than) operator with a double one >> for your outpu files not to be overwritten at each time.
_

Copyright © 2008 NoteWorthy Software™, Inc.
All Rights Reserved.