|Purpose:||Display the contents of files|
|Format:||VIEW [/= /A:[[-|+]rhsadecijopt /A /B /E /FIX /FLAT / GB /H /L /L:n ?LEN:n /O:xx /P /R /S:xx /T /TEXT /VH /W] file ...|
file One or more files.
See also LIST.
VIEW provides a fast and flexible way to view a file, without the overhead of loading and using a text editor. VIEW is a replacement for the old LIST command.
For example, to display a file called MEMO.TXT:
Note: VIEW is primarily intended for displaying the contents of ASCII, Unicode, and EBCDIC text files (i.e. alphanumeric characters arranged in lines separated by CR/LF). It can be used for other files which contain non-alphabetic characters or unusual line separators, but you may need to use hexadecimal mode (see below) to display or search these files.
If you don't specify any filenames on the VIEW command line, VIEW will first check to see if standard input has been redirected (i.e., with a pipe like "DIR | VIEW"). If so, VIEW will display the contents of standard input. If not, VIEW will display a dialog to allow you to select files to display.
VIEW can view CSV files as tables. CSV files are typically used to represent tabular data, where each line in the file represents a row of a table. Each line contains the text of each column in the row, separated by a comma (although other characters can be used, such as a tab). By default, VIEW will automatically recognize CSV files and will display them as a table - where all the columns have the same width (much like a spreadsheet). Although unlike a spreadsheet, the column widths in V are fixed (determined by the longest entry in the column) and cannot be resized. You can press the arrow button next to the new CSV Mode button in the toolbar to customize the CSV behavior. Press the CSV Mode button to toggle between CSV mode and standard text mode.
VIEW can also display the clipboard (CLIP:), FTP, and HTTP files.
You can override the default HTTP proxy server, proxy user, and proxy password (set in TCMD.INI) with the /Proxy... options.
When a line is too long to fit in the view, horizontal scroll bars appear at the bottom of the view, allowing you to scroll through the entire line. The horizontal scroll bars will appear when at least one line of the file being viewed is wider than the width of the view.
Sometimes scrolling through lines is not very convenient, particularly if a file contains many really long lines. In this case, lines can be wrapped. Lines may be wrapped in several ways:
Wrap to Screen
The lines are wrapped so that all text fits inside the file view. In this case, the horizontal scroll bars disappear. Screen wrapping may be toggled by selecting the Wrap to Screen command from the View menu, pressing the Wrap to Screen button on the toolbar, or by pressing Alt-W. Wrapping text to the screen may be permanently enabled by setting the Wrap lines to screen option in the Preferences Dialog box.
Wrap to Length
In this case, the lines are wrapped whenever they reach the wrap length. Wrapping may be toggled by selecting the Wrap to Length command from the View menu, pressing the Wrap to Length button on the toolbar, or by pressing Alt-L. The wrap length may be quickly changed by selecting the Set Wrap Length command from the View menu, or by pressing Ctrl-W. You may enter a new wrap length, or select a previously used length from the list.
Wrap on Word Boundary
Normally, lines will be wrapped at the exact position where they exceed the width of the view (if wrapping to screen), or the wrap length - even if it happens to be in the middle of a word. To ensure that lines are not split mid-word, select the Wrap on Word Boundary option from the Preferences Dialog box.
Hex mode displays a file as a series of hexadecimal (base 16) numbers together with the corresponding ASCII character equivalent (this is also known as Debug Format).
The first 8 digits on each line represents a hex address which indicates the position (or offset) of the corresponding line in the file. This is followed by up to 16 hex numbers (or bytes) which correspond to the file data. The right hand side of the view consists of the ASCII character representation of the corresponding file data If the hex byte does not correspond to a printable ASCII character, it is displayed as a "." (dot).
The File window can be split in two by clicking on the Split Screen button on the toolbar and selecting Horizontal or Vertical Split Mode. It can also be split from the Split submenu of the View menu, or by pressing Alt+S. This allows you to view different parts of the same file in different windows.
Note that both windows must use the same display mode. For example, you cannot have one window in hex mode and the other in text mode. Also, if you enable line wrapping, the wrapping will apply to both windows.
The ruler makes it easy to determine the position of a particular character. The ruler is displayed at the top of the File View and its format depends on the mode of the view.
If the view is in Text mode, the ruler consists of a sequence of incrementing numbers (starting at 1) which indicate the column number of the character below. In this case, the length of the ruler is determined by the length of the longest line in the file.
If the view is in Hex mode, the ruler always consists of 16 hex offsets (from 00 to 0F) which indicate the offset from the start of the line of the corresponding hex bytes displayed below.
The ruler may be dragged over any part of the file. The floating ruler may be removed by either double-clicking on it or by dragging it back to the top.
The ruler numbering usually starts at 1. To start from 0, right-click on the ruler with the Control key pressed and select the required option. Alternatively, you can press Ctrl+Alt+R to toggle the starting column.
Up to 10 floating rulers may be displayed while viewing a file. To create a new ruler simply drag it from the top (fixed) ruler. To close a ruler, double click on it. To close all rulers (but to remember their position), double click on the fixed ruler. To redisplay the floating rulers in their last position, double click again on the fixed ruler.
Right-clicking (or shift-clicking) on the ruler will cause a vertical grid line to be drawn at the clicked column position. The grid line will disappear once the button is released.
|/=||Display the VIEW command dialog to help you set the filename and command line options. The /= option can be anywhere on the line; additional options will set the appropriate fields in the command dialog.|
|/A:||Select only those files that have the specified attribute(s) set. See Attribute Switches for information on the attributes which can follow /A:. Do not use /A: with @file lists. See @file lists for details.|
You can specify /A:= to display a dialog to help you set individual attributes.
|/A||View the file in ASCII mode. This is the default mode and will only need to be specified in order to override an existing EBCDIC mode.|
|/B||View the file in EBCDIC mode. VIEW normally automatically determines if a file is EBCDIC and automatically sets this mode.|
|/FIX:n||When viewing a file, the display may be fixed at a certain column position so that any text to the left of the fixed column will always be visible (ie, it will not scroll off the screen).|
|/FLAT||Enables Flat Text Mode. This is a cross between text and hex modes. The file is displayed as text, however, control characters like line feeds and tabs are not expanded, and the file is always wrapped at the specified wrap length.|
|/L:n||Start displaying the file from line number n. A solid blue line will appear at the top of the file, indicating that a non-zero start offset is being used.|
|/R||When started with no parameters, VIEW will browse the current directory. By specifying the /R option, VIEW will display the directory that it last browsed.|
|/S||The /S option is used to tell VIEW to start displaying the file at the position of a string match. The format of the /S command line option is as follows:|
/S:SearchString /SO:[CWRHUB] /SN:n /SC:Columns
where SO can contain a series of letters which correspond to the options in the search dialog box. These can be one of:
|B||Search backwards (from end of file)|
SN indicates which occurrence of the string to find. By default, the first match is found (n=1).
SC can be used to restrict the search to certain columns.
If the search string contains spaces, you must enclose it in double quotes.
|/T||Enable File Tailing. If data is added to the file while you are viewing it, it will automatically be updated. There is no need to press the Refresh button to see any changes since the file was loaded. This is particularly useful when viewing log files while they are still being updated.|
|/VH||Display the file in Vertical Hex Mode. This is a cross between Text and Hex modes. The file is displayed one line at a time (just as in text mode). However, each line is followed by 2 lines containing the hex code of each character in the line.|