Modify ASCII File
COMMAND LICENSING AND DEFAULT MENU LOCATIONS
- The Modify ASCII File command is part of the RPS Tool Shed Toolbox.
- The command is located on the Tool Shed macros menu ribbon.
- The command is located in the Core menu group.
COMMAND DESCRIPTION
Utility to modify the contents of an ASCII file (CSV, PTS, XYZ, …) using formulas to alter columns of data.
COMMAND HISTORY
VIDEO DEMONSTRATION
The following video shows how to utilize the Modify ASCII File command:
SETUP AND CONFIGURATION
Command Interface Description
The Modify ASCII File command dialog looks as follows:
Data file:
Select the ASCII file that you wish to modify. Selected file type options include *.PTS, *.TXT, *.CSV, or .. The file content should be row-formatted data where the data items are separated by “,” (comma), “|” (pipe), “;” (semicolon), " " (space), or " " (Tab).
Preview:
The Preview pane shows the first few rows of content for the selected data file.
Column delimiter:
Select the data delimiter used in the file from the options provided: “,” (comma), “|” (pipe), “;” (semicolon), " " (space), or " " (Tab).
Skip first row checkbox:
If the first row of information is a header row, you can check this checkbox to eliminate it from the modification process.
Modifier Table:
The Modifier Table will be populated with the data values from the first row of data. For each column of information, you will see the column number, the type of value, e.g., Real, and the value read from the data file.
You can enter a formula into the Formula area of the table to adjust the read value. For example, if you want to multiply a value by -1, enter *-1 in this field. The read value is assumed to be the first element of the formula.
The result of the formulaic modification is displayed in the Result column as a check that you will get the required output.
Formula tips are provided in the dialog as an aid. Python programming language math functions are supported in the Formula fields. For more information, please contact us or refer to Python programming guides for additional details. The following link may be helpful - Click Here
INPUTS
Data File:
Select the ASCII file that you wish to modify. Supported file formats include PTS, TXT, CSV, and other compatible ASCII files.
Column Delimiter:
Select the character used to separate data values within the file. Available options include Comma, Pipe, Semicolon, Space, and Tab.
Skip First Row:
Check this checkbox to exclude the first row from the modification process when it contains column headers.
Modifier Table:
Review the columns of data identified in the selected file. The table displays the Column Number, Data Type, Original Value, Formula, and Result.
Formula:
Enter the mathematical expression that you wish to apply to the values in each column. The original value is used as the starting value for the calculation. Supported expressions include Python mathematical functions.
Result:
Displays a preview of the modified value based on the entered formula, allowing you to verify the calculation before processing the file.
REPORTS
The Modify ASCII File command does not generate a separate report.
The command creates a modified ASCII file containing the updated column values based on the formulas entered in the Modifier Table.
The output file is saved in the same folder as the original file, using the original filename with .out inserted before the file extension.
For example, a source file named Rockpile.PTS will generate an output file named Rockpile.out.PTS.
COMMAND BUTTONS
OK:
Executes the command and closes on completion. The output file will be written into the same folder as the source file you selected on your computer. The filename will be the same as the source filename but with an extension of .out.xxx, where xxx is the original file extension. For example, if the original file was called Rockpile.PTS, the output file will be called Rockpile.out.PTS.
Cancel:
Closes the command without further execution.
HELP
In the Help area, you will find a shortcut link to this Help document and training video. You can also access this document by pressing F1 on your keyboard.
USE CASE VIDEOS
The following videos show the use of the Linestring by Station command in a workflow context:
FEEDBACK AND ENHANCEMENT REQUESTS
If you would like to provide feedback on the use of the Modify ASCII File command or to request enhancements or improvements to the command, please click Reply below.

