|
| |
$FCOUNT (File Count)
Description
Count the number of text lines in a file.
Syntax
At the Command Prompt (library
IS NOT initialized)
|
C:\>NTCmdLib |
$FCOUNT VariableName|"[drive:][path]filename" |
At the Command Prompt (library
IS initialized)
|
C:\>L |
$FCOUNT VariableName|"[drive:][path]filename" |
In a Script (library IS NOT
initialized)
|
CALL
NTCmdLib |
$FCOUNT VariableName|"[drive:][path]filename" |
In a Script (library IS
initialized)
|
%.Call% |
$FCOUNT VariableName|"[drive:][path]filename" |
Parameters and Switches
| VariableName |
|
Name of a variable containing the filename to be counted. |
| "[drive:][path]filename" |
|
Specifies a file to be counted. Also accepts UNC paths such as
"\\server\share[\path]\filename". Filename must be quoted and may contain embedded spaces. |
Errorlevels, Output Variables and Custom Mount/\Commands
|
Name |
|
Value |
|
Description/Contents |
|
_FCOUNT |
|
numeric |
|
variable containing the total number of
lines in the input file. |
|
ErrorLevel |
|
Description/Contents |
|
0 |
|
Success |
|
2 |
|
Missing or invalid filename
Filename not quoted |
Examples, Notes and Instructions
Example 1 - standard usage with VariableName
|
C:\GuardPost>SET
"InputFile=c:\GuardPost\ntlib.cmd"
C:\GuardPost>SET
InputFile
InputFile=c:\GuardPost\ntlib.cmd
C:\GuardPost>NTCmdLib
$FCOUNT InputFile
^ =========================================================================
/!\ NTCmdLib.cmd 2003.04.24 NT/2K/XP/K3 ("Almost Freeware" at $9 or less!)
/LIB\ =========================================================================
_FCOUNT=1170
C:\GuardPost>SET
_FCOUNT
_FCOUNT=1170
C:\GuardPost>ECHO
%_FCOUNT%
1170
|
Example 2 - standard usage with "quoted filename"
|
C:\GuardPost>NTCmdLib /q
$FCOUNT "ntlib.cmd"
C:\GuardPost>ECHO
%_FCOUNT%
1170
|
Notes
- Output is displayed to STDOUT, errors to STDERR
- To suppress console display, use the library GlobalSwitch /Quiet (or simply /q)
NTCmdLib /Q TaskID /TaskSwitches Parameters
CALL NTCmdLib /Q TaskID
/TaskSwitches Parameters
%.Call% /Q TaskID /TaskSwitches Parameters
Related .Mount/\Commands, #Constants,
$Functions, :Procedures
|
Resource |
|
Short Description |
| |
|
|
|
K
E
Y |
Common Commands |
INTERNAL |
External |
/SWITCH |
Parameter |
Help text |
AddonTool |
|
Mounted Commands |
.Mount/\Command |
CmdShorthand |
#Constant |
$FUNCTION |
:Procedure |
!GuardNote |
|
Operating Systems |
NT/2K/XP/K3 |
NT Only |
NT/2K |
2K Only |
2K/XP |
XP Only |
XP/K3 |
K3 Only |
2K/XP/K3 |
|