EnglishFrenchSpanish

Ad


OnWorks favicon

gxyrs - Online in the Cloud

Run gxyrs in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command gxyrs that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


gxyrs - is a program to batch process XYRS files.

SYNOPSIS


gxyrs file [OPTIONS]

DESCRIPTION


XYRS files are usually generated by PCB design programs, and are used by board assemblers.

Format of XYRS files is discussed in FILES section.

Processing of these files is often needed by board assemblers or designers to suit their
process and tools flows.

gxyrs helps batch-processing these files. Rules and commands can be defined to make batch-
processing easy.

gxyrs consists on a perl library providing the core functions, and a perl script providing
some basic functionality.

It takes some arguments from the command line: input and output files, some modifiers, and
an action-file or an action-string.

The action-file or action-script contains some commands. For every line of the input file,
gxyrs executes those commands, which can modify the contents of the line, and then writes
the resulting line to the output file.

Since gxyrs is written in perl, actions are also written in this language.

OPTIONS


--help Display a usage message on standard output and exit successfully. --verbose
Display more information messages when processing files.

--process-comments
By default, gxyrs doesn't process lines starting with '*' and '#' characters.

It just copies these lines to the output, without further processing.

With this option, it processes these lines as well.

--tabulate
Give each field in the output file a fixed length, enough to contain the longest
string. Using this option make the output file easier to read by humans.

--caseinsensitive
Ignore case distinctions when comparing patterns.

--adjust FILE
File with the commands to process the input file.

--eval PATTERN
Interpret PATTERN as the commands to process the input file.

--output FILE
Save the output to the specified FILE.

If FILE string is "-" (without double quotes), then output is redirected to
standard output STDOUT.

--output-delimiter CHAR
Use the given CHAR as an output field delimiter.

PREDEFINED VARIABLES


gxyrs defines automatically the following variables:

REF_COL
column number (starting at 0) where the component reference is.

FOOTPRINT_COL
column number (starting at 0) where the component footprint is.

X_COL column number (starting at 0) where the component's X location coordinate is.

Y_COL column number (starting at 0) where the component's Y location coordinate is.

ANGLE_COL
column number (starting at 0) where the component rotation angle is.

LAYER_COL
column number (starting at 0) where the component's layer side location is.

VALUE_COL
column number (starting at 0) where the component's value is. Usually this is the
component's part number.

LINE_NUMBER
this is the line number of the input file that is being currently processed.

LINE array where each array element is a field or column of the input file's line being
processed.

BUILTIN COMMANDS


All the following commands accept a checklist parameter. A checklist is a list of one or
more check_items. A checkitem is a list of two single elements:

column_number
is the data index number 'n' of the global variable LINE to be checked. The first
element of the data has the number 1.

pattern
is the regular expression to be matched.

The commands will only be executed on those lines that match all the checkitems in the
checklist.

del_line checklist;
Delete the line (global variable LINE) if checklist is matched.

Returns -1 if error, 0 if not match, 1 if match and changed.

rotate_comp angle_col, angle, checklist;
rotate the component the degrees given in angle parameter, if checklist is matched.

The angle column number is angle_col.

Returns 1 if match and changed, 0 if not match, -1 if error.

subst_col_val col, value, checklist;
Replace a column value by the new value value, if checklist is matched.

Returns 1 if match and changed, 0 if not match, -1 if error.

change_col_units units, column_numbers;
Change units of a given column number. More than one column number can be
specified.

Units is a string with the desired units. Only "mm" (milimeters), "in" (inches) and
"mil" (thousands of an inch) are supported.

It is required that numbers to be converted are followed their units (see supported
units above). Otherwise, the number is not changed.

add_number_to_col col_number, value, checklist;
Adds a number to the value in a given column number. Note: offset and the value to
be changed can be in different units.

Returns -1 if error, -2 if warning, and 1 if success.

translate_col_val col_number, string, substitution, checklist;
Translate a string in the column col_number if checklist is matched.

Substitution is an expression with the new string. Old column value can be used
here.

Returns -1 if error, 0 if not match, 1 if match and changed.

Example:
translate 2, '^([0-9]+)n$','sprintf("%dnF",$1)', 3, 'C[0-9]+';
if the value in column 3 is C followed by a number, then
if the value in column 2 is a number followed by 'n', translate it to the same
value followed by 'nF'.
If there is 'C10' in column 3 and '10n' in column 2,
change '10n' to '10nF'.

mul_col_val col_number, factor, checklist;
Multiply the number in the specified column number col_number by the given factor,
if checklist is matched.

The number in the specified column number may have units at the end.

Returns -1 if error, 0 if not match, 1 if match and changed.

swap_columns col_number1, col_number2, checklist;
Swap columns col_number1 and col_number2 if checklist is matched.

Returns -1 if error, 0 if not match, 1 if match and changed.

insert_column col_number, new_column_value;
Insert a new column in the given col_number position (0 if it's going to be the
first column), with the value new_column_value.

Returns -1 if error, 1 if the new column was inserted.

RETURN VALUE


The return value of gxyrs is an integer with the following possible values:

1 if the command found a match and the execution was successful

0 if there was no match

-1 if there was an error

-2 if there was a warning

Use gxyrs online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

Linux commands

Ad