Return to the Sintran homepage Return to your previous page

Norsk Data & Sintran Data software1.5.9.1 - asc


asc

The asc is a small tool to display the ASCII table in variants and doing a few byte operations on files.

asc screen dump

Options

The wanted action is given as options on the command line, asc will not ask for any (missing) options/parameters but display an error message instead. Some options are mandatory, others are optional. The options are processed strictly from left to right, but when the action is executed depends on the type of option.

Some options are just switches that turns on/off features used by other options. Others have an an immediate action, while others are postponed until all options are parsed. Not all combinations of options are legal, and some options turn off options that cannot be used together.

-? - Display help/usage screen

Display the help/usage screen shown above.
D:\>asc -?
asc version D06 - 2021.01.09 (ND-291089 - 4.6.2.9) - Copyright (C) 2001-2021, Sintran Data

Usage:
  asc {options} {file(s)}

Options available:
  -?       - Display help/usage screen
  -a       - Display ASCII table
  -c{n}    - Character set (0..3)
:

-a - Display ASCII table

This is main goal for the tools, display the ASCII table. Although this is a mandatory option, it can be omitted. If none other options are given, the -a will automatically be selected.
D:\>asc -a
or just
D:\>asc
asc version D06 - 2021.01.09 (ND-291089 - 4.6.2.9) - Copyright (C) 2001-2021, Sintran Data

Hex +  0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F
-----------------------------------------------------
 00 :  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
 10 :  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
 20 :     !  "  #  $  %  &  '  (  )  *  +  ,  -  .  /
:

-c{n} - Character set (0..3)

Select the character set to be used. The graphical representation on your screen may differ due to local configuration.
  1. ASCII 7 bits, as used by Norsk Data
  2. ASCII 7 bits, as used by Norsk Data (as above) but with CTRL characters
  3. Code Page 437 MS-DOS Latin US, old DOS ASCII
  4. Windows-1252
D:\>asc -a -c1
asc version D06 - 2021.01.09 (ND-291089 - 4.6.2.9) - Copyright (C) 2001-2021, Sintran Data

Hex +  0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F
-----------------------------------------------------
 00 : ^@ ^A ^B ^C ^D ^E ^F ^G ^H ^I ^J ^K ^L ^M ^N ^O
 10 : ^P ^Q ^R ^S ^T ^U ^V ^W ^X ^Y ^Z ^[ ^\ ^] ^^ ^_
 20 :     !  "  #  $  %  &  '  (  )  *  +  ,  -  .  /
:

-d{x} - Character distribution (a=print all)

Display character distribution for a file. By using the '-da' alternative, all characters will be listed even they are not present in the given file.
D:\>asc -d file.txt
asc version D06 - 2021.01.09 (ND-291089 - 4.6.2.9) - Copyright (C) 2001-2021, Sintran Data

Hex   ASCII Distribution
------------------------
 0A :   .    37: *******
 0D :   .    37: *******
 20 :       467: ********************************...
 28 :   (     5: *
 29 :   )     5: *
 2C :   ,     1:
:

-f{file} - Input file name

This switch from ASCII display to file operations. The option must be followed by a file name either like this -ffile.txt or -f file.txt. The -f option is normally not necessary as it is implied when a file name is found. It can however be useful when f.eks. your file name starts with a minus ('-') to avoid that it is mistaken for an option. If your file name is '-myFile.txt' you can use the -f option like this -f-myFile.txt or you can do it like this .\-myFile.txt then avoiding the minus as the first character.
D:\>asc -c1 -d -f file.txt
asc version D06 - 2021.01.09 (ND-291089 - 4.6.2.9) - Copyright (C) 2001-2021, Sintran Data

Hex   ASCII Distribution
------------------------
 0A :  ^J    37: *******
 0D :  ^M    37: *******
 20 :       467: ********************************...
 28 :   (     5: *
 29 :   )     5: *
 2C :   ,     1:
:

-g{n} - Graphic bar, max value (0..255)

Defines the maximum number of stars in the graphic bar for the distribution list. If this value is zero, the graphic bar is turned off.
D:\>asc -d -g5 file.txt
asc version D06 - 2021.01.09 (ND-291089 - 4.6.2.9) - Copyright (C) 2001-2021, Sintran Data

Hex   ASCII Distribution
------------------------
 0A :   .    37:
 0D :   .    37:
 20 :       467: *****
 28 :   (     5:
 29 :   )     5:
 2C :   ,     1:
:

-h - Header

Turns off/on the headers which are normally present in various tables and lists.
D:\>asc -a -h
asc version D06 - 2021.01.09 (ND-291089 - 4.6.2.9) - Copyright (C) 2001-2021, Sintran Data

  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
     !  "  #  $  %  &  '  (  )  *  +  ,  -  .  /
:

-l - Display list instead of table

Switch the display of the ASCII table to list view.
D:\>asc -a -l
asc version D06 - 2021.01.09 (ND-291089 - 4.6.2.9) - Copyright (C) 2001-2021, Sintran Data

Hex   ASCII Comment
-------------------
 00 :   .   NUL - Null
 01 :   .   SOH - Start of Heading
 02 :   .   STX - Start of Text
 03 :   .   ETX - End of Text
 04 :   .   EOT - End of Transmission
 05 :   .   ENQ - Enquiry
:

-n{x} - Number format (hex, dec, oct, bin)

Change the number base to another than the default hex notation. You can select more than one at the same time.
D:\>asc -a -ndh
asc version D06 - 2021.01.09 (ND-291089 - 4.6.2.9) - Copyright (C) 2001-2021, Sintran Data

Hex     +  0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F
    Dec +  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
---------------------------------------------------------
 00   0 :  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
 10  16 :  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
 20  32 :     !  "  #  $  %  &  '  (  )  *  +  ,  -  .  /
:

-o{file} - Output file name

This redirects the output to a file instead of to the display. The -o option may be followed by a file name, which will be overwritten if it already exists. It can not be the same as the input file, the input file will be corrupted (empty). In the case where no file name is given, asc will create a file name automatically. This autogenerated file name will always be the same as the input file name with the extension .asc appended. The -o option is only used together with the -p option, it will be ignored for all other options. Here, the -f option turn out to be very useful, to prevent your input file from being unintentionally used as the output file.

In this example the output file will be automatically created with the name file.txt.asc and contains the content of the file.txt with the parity bit cleared.
D:\>asc -p -o -f file.txt
asc version D06 - 2021.01.09 (ND-291089 - 4.6.2.9) - Copyright (C) 2001-2021, Sintran Data

asc version D06 - Exit

-p{x} - Parity (0, 1, even, none, odd)

Change the parity bit for all the bytes in the input file. The -o option can be used here to redirect the result to a separate output file, instead of the standard output.

The parity bit can be set to:
D:\>asc -p0 -o -f file.txt
asc version D06 - 2021.01.09 (ND-291089 - 4.6.2.9) - Copyright (C) 2001-2021, Sintran Data

asc version D06 - Exit

-s - Statistics

Print some statistics data at the end of a file operation.

The statistics look like this when used with the -p option.
D:\>asc -p0 -o -s -f file.txt
asc version D06 - 2021.01.09 (ND-291089 - 4.6.2.9) - Copyright (C) 2001-2021, Sintran Data

File name     : file.txt
File size     : 1487 bytes (1 KB)
Output to     : file.txt.asc
File action   : Set parity to zero

asc version D06 - Exit
Here is a statistics example when used together with the -d option.
D:\>asc -d -s file.txt
asc version D06 - 2021.01.09 (ND-291089 - 4.6.2.9) - Copyright (C) 2001-2021, Sintran Data

Hex   ASCII Distribution
------------------------
 0A :   .    30: ******
 0D :   .    30: ******
:
 79 :   y     5: *
 FF :   .    16: ***

File name     : file.txt
File size     : 1332 bytes (1 KB)
File action   : Distribution
Unique bytes  : 62
Print all     : No
Graphics      : Yes
Max stars     : 100
One star      : 4.40
Min count     :   1 for ASCII value 4A (Hex)
Max count     : 440 for ASCII value 20 (Hex)

asc version D06 - Exit

-v - Verbose mode

Toggles the verbose mode.
D:\>asc -v -?
Usage:
  asc {options} {file(s)}

Options available:
  -?       - Display help/usage screen            - Default: Off
  -a       - Display ASCII table                  - Default: Off
  -c{n}    - Character set (0..3)                 - Default: 0
:

-vv - Very verbose mode

Toggles the very verbose mode.
D:\>asc -vv -?
asc version D06 - 2021.01.09 (ND-291089 - 4.6.2.9) - Copyright (C) 2001-2021, Sintran Data

DosLibrary version C01 - 2021.01.09 (ND-291057 - 3.1.1.9) - Copyright (C) 2014-2021, Sintran Data

asc is a small utility to display the ASCII table.
Some byte operations on files are also available.

Usage:
  asc {options} {file(s)}

Options available:
  -?       - Display help/usage screen            - Default: Off
  -a       - Display ASCII table                  - Default: Off
  -c{n}    - Character set (0..3)                 - Default: 0
:

-x - Extended ASCII codes

Turn the extended ASCII codes on/off. The normal ASCII table/list only show the first 128 characters, by using the -x option you can see all the 256 characters.
D:\>asc -a -l -x
asc version D06 - 2021.01.09 (ND-291089 - 4.6.2.9) - Copyright (C) 2001-2021, Sintran Data

Hex   ASCII Comment
-------------------
 00 :   .   NUL - Null
 01 :   .   SOH - Start of Heading
 02 :   .   STX - Start of Text
 03 :   .   ETX - End of Text
 04 :   .   EOT - End of Transmission
 05 :   .   ENQ - Enquiry
:
 FA :   z   Lowercase z
 FB :   {   Opening brace
 FC :   |   Vertical line
 FD :   }   Closing brace
 FE :   ~   Tilde
 FF :   .   Delete

asc version D06 - Exit

Redirections and pipes

This utility can be used with the redirect features and pipes available in DOS.

Redirect both the input and the output.
D:\>asc -d < file1.txt > file2.txt
Using pipes.
D:\>dir|asc -d|more
asc version D06 - 2021.01.09 (ND-291089 - 4.6.2.9) - Copyright (C) 2001-2021, Sintran Data

Hex   ASCII Distribution
------------------------
 0A :   .    33: ******
 20 :       484: ********************************...
 28 :   (     2:
:
 4C :   L     3:
 4D :   M     6: *
 4E :   N     1:
-- More  --

Download

ND noProductLanguageReleaseTitleDownloadFilesSizeMD5SUM
291089D00ascENSep. 2018ASCII tables and byte operationsZIP file114 KB6FD7EDFA502CD6C6288D785AA7ECFD72
291089D06ascENJan. 2021ASCII tables and byte operationsZIP file119 KBA5A16FFE6DF3E098A211118128FF6931

Version history


This page was last updated 27. Jan. 2025
Copyright © Sintran Data
../valid HTML code ../valid CSS code
Mail us