Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > e178d4401f38227bf480f73b93a254d0 > files > 25

geda-utils-1.8.1-6.mga4.x86_64.rpm

<!-- Creator     : groff version 1.21 -->
<!-- CreationDate: Fri Nov 23 21:34:34 2012 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta name="Content-Style" content="text/css">
<style type="text/css">
       p       { margin-top: 0; margin-bottom: 0; vertical-align: top }
       pre     { margin-top: 0; margin-bottom: 0; vertical-align: top }
       table   { margin-top: 0; margin-bottom: 0; vertical-align: top }
       h1      { text-align: center }
</style>
<title>gxyrs</title>

</head>
<body>

<h1 align="center">gxyrs</h1>

<a href="#NAME">NAME</a><br>
<a href="#SYNOPSIS">SYNOPSIS</a><br>
<a href="#DESCRIPTION">DESCRIPTION</a><br>
<a href="#OPTIONS">OPTIONS</a><br>
<a href="#PREDEFINED VARIABLES">PREDEFINED VARIABLES</a><br>
<a href="#BUILTIN COMMANDS">BUILTIN COMMANDS</a><br>
<a href="#RETURN VALUE">RETURN VALUE</a><br>
<a href="#FILES">FILES</a><br>
<a href="#EXAMPLES">EXAMPLES</a><br>
<a href="#SEE ALSO">SEE ALSO</a><br>

<hr>


<h2>NAME
<a name="NAME"></a>
</h2>


<p style="margin-left:11%; margin-top: 1em"><b>gxyrs</b>
&minus; is a program to batch process XYRS files.</p>

<h2>SYNOPSIS
<a name="SYNOPSIS"></a>
</h2>


<p style="margin-left:11%; margin-top: 1em"><b>gxyrs
file</b> [OPTIONS]</p>

<h2>DESCRIPTION
<a name="DESCRIPTION"></a>
</h2>


<p style="margin-left:11%; margin-top: 1em">XYRS files are
usually generated by PCB design programs, and are used by
board assemblers.</p>

<p style="margin-left:11%; margin-top: 1em">Format of XYRS
files is discussed in FILES section.</p>

<p style="margin-left:11%; margin-top: 1em">Processing of
these files is often needed by board assemblers or designers
to suit their process and tools flows.</p>

<p style="margin-left:11%; margin-top: 1em"><b>gxyrs</b>
helps batch-processing these files. Rules and commands can
be defined to make batch-processing easy.</p>

<p style="margin-left:11%; margin-top: 1em"><b>gxyrs</b>
consists on a perl library providing the core functions, and
a perl script providing some basic functionality.</p>

<p style="margin-left:11%; margin-top: 1em">It takes some
arguments from the command line: input and output files,
some modifiers, and an action-file or an action-string.</p>

<p style="margin-left:11%; margin-top: 1em">The action-file
or action-script contains some commands. For every line of
the input file, <b>gxyrs</b> executes those commands, which
can modify the contents of the line, and then writes the
resulting line to the output file.</p>

<p style="margin-left:11%; margin-top: 1em">Since
<b>gxyrs</b> is written in perl, actions are also written in
this language.</p>

<h2>OPTIONS
<a name="OPTIONS"></a>
</h2>


<table width="100%" border="0" rules="none" frame="void"
       cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="9%">


<p style="margin-top: 1em"><b>--help</b></p></td>
<td width="2%"></td>
<td width="78%">


<p style="margin-top: 1em">Display a usage message on
standard output and exit successfully.
<b>&minus;-verbose</b> Display more information messages
when processing files.</p></td></tr>
</table>


<p style="margin-left:11%;"><b>&minus;-process-comments</b></p>

<p style="margin-left:22%;">By default, gxyrs doesn&rsquo;t
process lines starting with &rsquo;*&rsquo; and
&rsquo;#&rsquo; characters.</p>

<p style="margin-left:22%; margin-top: 1em">It just copies
these lines to the output, without further processing.</p>

<p style="margin-left:22%; margin-top: 1em">With this
option, it processes these lines as well.</p>

<p style="margin-left:11%;"><b>&minus;-tabulate</b></p>

<p style="margin-left:22%;">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.</p>


<p style="margin-left:11%;"><b>&minus;-caseinsensitive</b></p>

<p style="margin-left:22%;">Ignore case distinctions when
comparing patterns.</p>

<p style="margin-left:11%;"><b>&minus;-adjust</b>
<i>FILE&nbsp;</i></p>

<p style="margin-left:22%;">File with the commands to
process the input file.</p>

<p style="margin-left:11%;"><b>&minus;-eval</b>
<i>PATTERN&nbsp;</i></p>

<p style="margin-left:22%;">Interpret PATTERN as the
commands to process the input file.</p>

<p style="margin-left:11%;"><b>&minus;-output</b>
<i>FILE&nbsp;</i></p>

<p style="margin-left:22%;">Save the output to the
specified FILE.</p>

<p style="margin-left:22%; margin-top: 1em">If FILE string
is &quot;-&quot; (without double quotes), then output is
redirected to standard output STDOUT.</p>


<p style="margin-left:11%;"><b>&minus;-output-delimiter</b>
<i>CHAR&nbsp;</i></p>

<p style="margin-left:22%;">Use the given CHAR as an output
field delimiter.</p>

<h2>PREDEFINED VARIABLES
<a name="PREDEFINED VARIABLES"></a>
</h2>


<p style="margin-left:11%; margin-top: 1em">gxyrs defines
automatically the following variables: <b><br>
REF_COL</b></p>

<p style="margin-left:22%;">column number (starting at 0)
where the component reference is.</p>

<p style="margin-left:11%;"><b>FOOTPRINT_COL</b></p>

<p style="margin-left:22%;">column number (starting at 0)
where the component footprint is.</p>

<table width="100%" border="0" rules="none" frame="void"
       cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="7%">


<p><b>X_COL</b></p></td>
<td width="4%"></td>
<td width="78%">


<p>column number (starting at 0) where the
component&rsquo;s X location coordinate is.</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="7%">


<p><b>Y_COL</b></p></td>
<td width="4%"></td>
<td width="78%">


<p>column number (starting at 0) where the
component&rsquo;s Y location coordinate is.</p></td></tr>
</table>

<p style="margin-left:11%;"><b>ANGLE_COL</b></p>

<p style="margin-left:22%;">column number (starting at 0)
where the component rotation angle is.</p>

<p style="margin-left:11%;"><b>LAYER_COL</b></p>

<p style="margin-left:22%;">column number (starting at 0)
where the component&rsquo;s layer side location is.</p>

<p style="margin-left:11%;"><b>VALUE_COL</b></p>

<p style="margin-left:22%;">column number (starting at 0)
where the component&rsquo;s value is. Usually this is the
component&rsquo;s part number.</p>

<p style="margin-left:11%;"><b>LINE_NUMBER</b></p>

<p style="margin-left:22%;">this is the line number of the
input file that is being currently processed.</p>

<table width="100%" border="0" rules="none" frame="void"
       cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="6%">


<p><b>LINE</b></p></td>
<td width="5%"></td>
<td width="78%">


<p>array where each array element is a field or column of
the input file&rsquo;s line being processed.</p></td></tr>
</table>

<h2>BUILTIN COMMANDS
<a name="BUILTIN COMMANDS"></a>
</h2>


<p style="margin-left:11%; margin-top: 1em">All the
following commands accept a <i>checklist</i> parameter. A
<i>checklist</i> is a list of one or more
<i>check_items</i>. A <i>checkitem</i> is a list of two
single elements: <b><br>
column_number</b></p>

<p style="margin-left:22%;">is the data index number
&rsquo;n&rsquo; of the global variable <b>LINE</b> to be
checked. The first element of the data has the number 1.</p>

<p style="margin-left:11%;"><b>pattern</b></p>

<p style="margin-left:22%;">is the regular expression to be
matched.</p>

<p style="margin-left:11%; margin-top: 1em">The commands
will only be executed on those lines that match all the
<i>checkitems</i> in the <i>checklist</i>. <b><br>
del_line</b> <i>checklist</i><b>;</b></p>

<p style="margin-left:22%;">Delete the line (global
variable <b>LINE</b>) if <i>checklist</i> is matched.</p>

<p style="margin-left:22%; margin-top: 1em">Returns
&minus;1 if error, 0 if not match, 1 if match and
changed.</p>

<p style="margin-left:11%;"><b>rotate_comp</b>
<i>angle_col</i><b>,</b> <i>angle</i><b>,</b>
<i>checklist</i><b>;</b></p>

<p style="margin-left:22%;">rotate the component the
degrees given in <i>angle</i> parameter, if <i>checklist</i>
is matched.</p>

<p style="margin-left:22%; margin-top: 1em">The angle
column number is <i>angle_col</i>.</p>

<p style="margin-left:22%; margin-top: 1em">Returns 1 if
match and changed, 0 if not match, &minus;1 if error.</p>

<p style="margin-left:11%;"><b>subst_col_val</b>
<i>col</i><b>,</b> <i>value</i><b>,</b>
<i>checklist</i><b>;</b></p>

<p style="margin-left:22%;">Replace a column value by the
new value <i>value</i>, if <i>checklist</i> is matched.</p>

<p style="margin-left:22%; margin-top: 1em">Returns 1 if
match and changed, 0 if not match, &minus;1 if error.</p>

<p style="margin-left:11%;"><b>change_col_units</b>
<i>units</i><b>,</b> <i>column_numbers</i><b>;</b></p>

<p style="margin-left:22%;">Change units of a given column
number. More than one column number can be specified.</p>

<p style="margin-left:22%; margin-top: 1em"><i>Units</i> is
a string with the desired units. Only &quot;mm&quot;
(milimeters), &quot;in&quot; (inches) and &quot;mil&quot;
(thousands of an inch) are supported.</p>

<p style="margin-left:22%; margin-top: 1em">It is required
that numbers to be converted are followed their units (see
supported units above). Otherwise, the number is not
changed.</p>

<p style="margin-left:11%;"><b>add_number_to_col</b>
<i>col_number</i><b>,</b> <i>value</i><b>,</b>
<i>checklist</i><b>;</b></p>

<p style="margin-left:22%;">Adds a number to the value in a
given column number. Note: offset and the value to be
changed can be in different units.</p>

<p style="margin-left:22%; margin-top: 1em">Returns
&minus;1 if error, &minus;2 if warning, and 1 if
success.</p>

<p style="margin-left:11%;"><b>translate_col_val</b>
<i>col_number</i><b>,</b> <i>string</i><b>,</b>
<i>substitution</i><b>,</b> <i>checklist</i><b>;</b></p>

<p style="margin-left:22%;">Translate a <i>string</i> in
the column <i>col_number</i> if <i>checklist</i> is
matched.</p>


<p style="margin-left:22%; margin-top: 1em"><i>Substitution</i>
is an expression with the new string. Old column value can
be used here.</p>

<p style="margin-left:22%; margin-top: 1em">Returns
&minus;1 if error, 0 if not match, 1 if match and
changed.</p>

<p style="margin-left:22%; margin-top: 1em">Example: <br>
translate 2,
&rsquo;^([0-9]+)n$&rsquo;,&rsquo;sprintf(&quot;%dnF&quot;,$1)&rsquo;,
3, &rsquo;C[0-9]+&rsquo;; <br>
if the value in column 3 is C followed by a number, then
<br>
if the value in column 2 is a number followed by
&rsquo;n&rsquo;, translate it to the same value followed by
&rsquo;nF&rsquo;. <br>
If there is &rsquo;C10&rsquo; in column 3 and
&rsquo;10n&rsquo; in column 2, <br>
change &rsquo;10n&rsquo; to &rsquo;10nF&rsquo;.</p>

<p style="margin-left:11%;"><b>mul_col_val</b>
<i>col_number</i><b>,</b> <i>factor</i><b>,</b>
<i>checklist</i><b>;</b></p>

<p style="margin-left:22%;">Multiply the number in the
specified column number <i>col_number</i> by the given
<i>factor</i>, if <i>checklist</i> is matched.</p>

<p style="margin-left:22%; margin-top: 1em">The number in
the specified column number may have units at the end.</p>

<p style="margin-left:22%; margin-top: 1em">Returns
&minus;1 if error, 0 if not match, 1 if match and
changed.</p>

<p style="margin-left:11%;"><b>swap_columns</b>
<i>col_number1</i><b>,</b> <i>col_number2</i><b>,</b>
<i>checklist</i><b>;</b></p>

<p style="margin-left:22%;">Swap columns <i>col_number1</i>
and <i>col_number2</i> if <i>checklist</i> is matched.</p>

<p style="margin-left:22%; margin-top: 1em">Returns
&minus;1 if error, 0 if not match, 1 if match and
changed.</p>

<p style="margin-left:11%;"><b>insert_column</b>
<i>col_number</i><b>,</b>
<i>new_column_value</i><b>;</b></p>

<p style="margin-left:22%;">Insert a new column in the
given <i>col_number</i> position (0 if it&rsquo;s going to
be the first column), with the value
<i>new_column_value</i>.</p>

<p style="margin-left:22%; margin-top: 1em">Returns
&minus;1 if error, 1 if the new column was inserted.</p>

<h2>RETURN VALUE
<a name="RETURN VALUE"></a>
</h2>


<p style="margin-left:11%; margin-top: 1em">The return
value of <b>gxyrs</b> is an integer with the following
possible values: <br>
1 if the command found a match and the execution was
successful</p>

<p style="margin-left:11%; margin-top: 1em">0 if there was
no match</p>

<p style="margin-left:11%; margin-top: 1em">&minus;1 if
there was an error</p>

<p style="margin-left:11%; margin-top: 1em">&minus;2 if
there was a warning</p>

<h2>FILES
<a name="FILES"></a>
</h2>


<p style="margin-left:11%; margin-top: 1em"><b>XYRS
files</b></p>

<p style="margin-left:22%;">The format of these files is
not standard, and depends on the application used to
generate it.</p>

<p style="margin-left:22%; margin-top: 1em">The data stored
in these files is usually a header, and one line per
component of the board.</p>

<p style="margin-left:22%; margin-top: 1em">For each
component, at least the following information is needed by
assemblers:</p>

<p style="margin-left:22%; margin-top: 1em">- Reference</p>

<p style="margin-left:22%; margin-top: 1em">- Coordinates
(X and Y)</p>

<p style="margin-left:22%; margin-top: 1em">- Rotation
angle</p>

<p style="margin-left:22%; margin-top: 1em">- Side where
the component is located (top or bottom)</p>

<p style="margin-left:22%; margin-top: 1em">There can be
more information, such as description, footprint, but this
depends on the design program an its configuration.</p>

<p style="margin-left:22%; margin-top: 1em">This
information is organized in lines, one line per component,
and each line is divided in as much fields or columns as
needed. Field delimiters are used between columns, but field
delimiters are not standardized and they depend on the
program used to generate the XYRS file.</p>

<p style="margin-left:22%; margin-top: 1em">The program
that generates the XYRS file usually write a header (usually
the first two or thre lines in the file) with a column
title.</p>

<p style="margin-left:22%; margin-top: 1em"><b>gxyrs</b>
tries to guess the file format, and column numbers, based on
this header. Thus, the known column titles are the
following:</p>

<p style="margin-left:22%; margin-top: 1em">- for reference
designator: <i>Designator</i>, <i>RefDesignator</i>,
<i>RefDes</i>.</p>

<p style="margin-left:22%; margin-top: 1em">- for
footprint: <i>Footprint</i>, <i>TopCell</i>,
<i>Description</i> (only if there is no other
&quot;TopCell&quot; column title).</p>

<p style="margin-left:22%; margin-top: 1em">- for X
coordinate: <i>Mid X</i>, <i>X</i>.</p>

<p style="margin-left:22%; margin-top: 1em">- for Y
coordinate: <i>Mid Y</i>, <i>Y</i>.</p>

<p style="margin-left:22%; margin-top: 1em">- for rotation
angle: <i>Rotation</i>, <i>rotation</i>, <i>Rot</i>.</p>

<p style="margin-left:22%; margin-top: 1em">- for location
side: <i>TB</i>, <i>Side</i>, <i>top/bottom</i>.</p>

<p style="margin-left:22%; margin-top: 1em">- for value:
<i>Comment</i>, <i>PartNumber</i>, <i>Value</i>.</p>

<p style="margin-left:11%;"><b>Action files</b></p>

<p style="margin-left:22%;">An action file contains a list
of commands, using perl language, that can include any call
to a built-in function or use any variable defined by
<i>gxyrs</i>.</p>

<p style="margin-left:22%; margin-top: 1em">Each action
file should end with the following line (with a carrier
return at the end of the line):</p>

<p style="margin-left:22%; margin-top: 1em">1;</p>

<h2>EXAMPLES
<a name="EXAMPLES"></a>
</h2>


<p style="margin-left:11%; margin-top: 1em"><b>Run an
action file:</b></p>

<p style="margin-left:22%;">Run the action file
<i>your_comands.txt</i> with the XYRS file
<i>your_xyrs_file.txt</i> and write the output result to the
file <i>output_file.txt</i>:</p>

<p style="margin-left:22%; margin-top: 1em">gxyrs
your_xyrs_file.txt &minus;&minus;adjust your_commands.txt
&minus;&minus;output output_file.txt</p>

<p style="margin-left:11%;"><b>Run a command specified in
the command line:</b></p>

<p style="margin-left:22%;">Run the commands
<i>your_commands</i> wiith the XYRS file
<i>your_xyrs_file.txt</i> and write the output result to the
file <i>output_file.txt</i>:</p>

<p style="margin-left:22%; margin-top: 1em">gxyrs
your_xyrs_file.txt &minus;&minus;eval
&quot;your_commands&quot; &minus;&minus;output
output_file.txt</p>

<p style="margin-left:11%;"><b>Delete some lines matching a
pattern.</b></p>

<p style="margin-left:22%;">Parse the XYRS file
<i>your_xyrs_file.txt</i>, delete all lines having a R
followed by a number in column number 2, and write the
output result to the file <i>output_file.txt</i>:</p>

<p style="margin-left:22%; margin-top: 1em">gxyrs
your_xyrs_file.txt &minus;&minus;eval &quot;del 2,
&rsquo;R[0&minus;9]+&rsquo;;&quot; &minus;&minus;output
output_file.txt</p>

<p style="margin-left:11%;"><b>Delete some lines matching a
pattern, using the column number guessed <br>
by gxyrs.</b></p>

<p style="margin-left:22%;">Parse the XYRS file
<i>your_xyrs_file.txt</i>, delete all lines having a R
followed by a number in reference designator column, and
write the output result to the file
<i>output_file.txt</i>:</p>

<table width="100%" border="0" rules="none" frame="void"
       cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="7%"></td>
<td width="85%">


<p>gxyrs your_xyrs_file.txt &minus;&minus;eval &quot;del
\$REF_COL, &rsquo;R[0&minus;9]+&rsquo;;&quot;
&minus;&minus;output output_file.txt</p></td></tr>
</table>

<p style="margin-left:11%;"><b>Rotate some lines matching a
pattern.</b></p>

<p style="margin-left:22%;">Parse the XYRS file
<i>your_xyrs_file.txt</i>, rotate by 90&Acirc;&ordm; all
lines having a R followed by a number in reference
designator column, and write the output result to the file
<i>output_file.txt</i>. Use the rotation and reference
column number guessed by <i>gxyrs</i>:</p>

<table width="100%" border="0" rules="none" frame="void"
       cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="7%"></td>
<td width="85%">


<p>gxyrs your_xyrs_file.txt &minus;&minus;eval &quot;rotate
\$ANGLE_COL, 90, \$REF_COL,
&rsquo;R[0&minus;9]+&rsquo;;&quot; &minus;&minus;output
output_file.txt</p> </td></tr>
</table>

<p style="margin-left:11%;"><b>Change all numbers to
&rsquo;mm&rsquo; units.</b></p>

<p style="margin-left:22%;">Parse the XYRS file
<i>your_xyrs_file.txt</i>, convert all numbers in column 3
and 5 to its equivalent in mm, and write the output result
to the file <i>output_file.txt</i>:</p>

<table width="100%" border="0" rules="none" frame="void"
       cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="7%"></td>
<td width="85%">


<p>gxyrs your_xyrs_file.txt &minus;&minus;eval
&quot;change_units &rsquo;mm&rsquo;, 3, 5;&quot;
&minus;&minus;output output_file.txt</p></td></tr>
</table>

<p style="margin-left:11%;"><b>Replace a value matching a
pattern with another value.</b></p>

<p style="margin-left:22%;">Parse the XYRS file
<i>your_xyrs_file.txt</i>, if the value in column 3 is
&quot;0.1u&quot;, then replace it with &quot;100nF&quot;,
and write the output result to the file
<i>output_file.txt</i>:</p>

<table width="100%" border="0" rules="none" frame="void"
       cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="7%"></td>
<td width="85%">


<p>gxyrs your_xyrs_file.txt &minus;&minus;eval &quot;subst
3 , &rsquo;100nF&rsquo;, 3, &rsquo;0.1u&rsquo;&quot;
&minus;&minus;output output_file.txt</p></td></tr>
</table>

<p style="margin-left:11%;"><b>Change the reference of a
component with a value matching a pattern.</b></p>

<p style="margin-left:22%;">Parse the XYRS file
<i>your_xyrs_file.txt</i>, if the value in value column is
&quot;1n4148&quot;, then replace reference column with
&quot;D1&quot;, and write the output result to the file
<i>output_file.txt</i>:</p>

<table width="100%" border="0" rules="none" frame="void"
       cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="7%"></td>
<td width="85%">


<p>gxyrs your_xyrs_file.txt &minus;&minus;eval &quot;subst
\$REF_COL , &rsquo;D1&rsquo;, \$VALUE_COL,
&rsquo;1n4148&rsquo;;&quot; &minus;&minus;output
output_file.txt</p> </td></tr>
</table>

<p style="margin-left:11%;"><b>Adds an offset to the X
coordinate of a component with a reference <br>
having a R followed by a number.</b></p>

<p style="margin-left:22%;">Parse the XYRS file
<i>your_xyrs_file.txt</i>, if the text in reference column
is R followed by a number, then adds 102.5mm to the value in
X coordinate column, and write the output result to the file
<i>output_file.txt</i>.</p>

<p style="margin-left:22%; margin-top: 1em">Value in column
3 can be in other units (for example:
&rsquo;640mil&rsquo;):</p>

<table width="100%" border="0" rules="none" frame="void"
       cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="7%"></td>
<td width="85%">


<p>gxyrs your_xyrs_file.txt &minus;&minus;eval &quot;offset
\$X_COL, &rsquo;102.5mm&rsquo;, \$REF_COL,
&rsquo;R[0&minus;9]+&rsquo; ;&quot; &minus;&minus;output
output_file.txt</p> </td></tr>
</table>

<p style="margin-left:11%;"><b>Multiply the value of the X
coordinate of a component by a number, if <br>
the component reference is having a R followed by a
number.</b></p>

<p style="margin-left:22%;">Parse the XYRS file
<i>your_xyrs_file.txt</i>, if the text in reference column
is R followed by a number, then multiply the value in X
coordinate column by 2.5, and write the output result to the
file <i>output_file.txt</i>.</p>

<p style="margin-left:22%; margin-top: 1em">Value in column
3 can be in other units (for example:
&rsquo;640mil&rsquo;):</p>

<table width="100%" border="0" rules="none" frame="void"
       cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="7%"></td>
<td width="85%">


<p>gxyrs your_xyrs_file.txt &minus;&minus;eval
&quot;mul_col_val \$X_COL, 2.5, \$REF_COL,
&rsquo;R[0&minus;9]+&rsquo; ;&quot; &minus;&minus;output
output_file.txt</p> </td></tr>
</table>

<p style="margin-left:11%;"><b>Swap two columns.</b></p>

<p style="margin-left:22%;">Parse the XYRS file
<i>your_xyrs_file.txt</i>, swap columns 3 and 4 if the text
in column number 4 is R followed by a number, and write the
output result to the file <i>output_file.txt</i>:</p>

<table width="100%" border="0" rules="none" frame="void"
       cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="7%"></td>
<td width="85%">


<p>gxyrs your_xyrs_file.txt &minus;&minus;eval
&quot;swap_columns 3, 4, 4, &rsquo;R[0&minus;9]+&rsquo;
;&quot; &minus;&minus;output output_file.txt</p></td></tr>
</table>

<p style="margin-left:11%;"><b>Insert a column.</b></p>

<p style="margin-left:22%;">Insert a column in the first
position, displacing all existing columns to the right.
Column value is &rsquo;new_column_value&rsquo;:</p>

<table width="100%" border="0" rules="none" frame="void"
       cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="8%"></td>
<td width="7%"></td>
<td width="85%">


<p>gxyrs your_xyrs_file.txt &minus;&minus;eval
&quot;insert_column 0, &rsquo;new_column_value&rsquo;;&quot;
&minus;&minus;output output_file.txt</p></td></tr>
</table>

<h2>SEE ALSO
<a name="SEE ALSO"></a>
</h2>


<p style="margin-left:11%; margin-top: 1em"><b>regex(7),
GNU regular expression manual</b></p>
<hr>
</body>
</html>