---
title: Flat File Fixed Width Search Field Expression Plugin – Extract Values by Position
description: "Extract values from fixed-width message bodies with the Nodinite Flat File Fixed Width Search Field Expression plugin: zero-based start position, length, and row selection, with tested examples."
---

# <i class="fal fa-magnifying-glass" aria-hidden="true"></i> Flat File Fixed Width Search Field Expression Plugin

The **Flat file Fixed width** plugin extracts [Search Field][Search Fields] values from the Message Body of a [Log Event][] by character position: on each line it reads a set number of characters from a zero-based start position. Use it for fixed-width records from mainframe, AS/400, and other legacy systems, where fields have no delimiter.

* ✅ Extracts by Start position on line and Length, no delimiter needed  
* ✅ Limits extraction to chosen rows with Rows to include and Rows to skip  

![Flat file Fixed width returns the order numbers 10001 and 10002 from a legacy order export, animated walkthrough (7.12)][7]  
*Animated walkthrough: **Start position on line** `3` and **Length** `5` on a logged fixed-width order export return `10001` and `10002`; `10001` is on two lines and is returned once.*  

## <i class="fal fa-scale-balanced" aria-hidden="true"></i> When to use it

| Your data | Use |
| --- | --- |
| Fixed-width records in the Message Body, value at a known character position | **Flat file Fixed width** (this plugin) |
| CSV or other delimited text, value in a known column | [Flat file CSV][Flat File CSV] |
| Text where the value's position varies but its pattern is known | [RegEx][] |
| Content you need to transform or combine, or that sits in a context property | [Formula][] |

For all plugins side by side, see [Choose a plugin][].

## <i class="fal fa-code" aria-hidden="true"></i> Expression syntax

Select **Flat file Fixed width** in the **Type** list, then fill in the fields of the **Expressions** group:

![Type list filtered on flat, showing Flat file CSV and Flat file Fixed width (7.12)][1]  
*The Flat file Fixed width plugin in the Type list.*  

| Field | What goes in it |
| --- | --- |
| **Start position on line** | The zero-based character position where the value starts: `0` is the first character on the line. |
| **Length** | The number of characters to read. Position `4` with length `3` reads characters 4 to 6. |
| **Start position from line end** | Shown when **Start position on line** is empty. The value starts this many characters before the line end. |
| **To position from line end** | Shown when **Length** is empty. The value ends this many characters before the line end. |
| **Row number to include** | Optional. A single row to extract from. Rows are numbered from `1`. |
| **Row number to skip** | Optional. A single row to leave out, such as a header row `1`. |
| **Rows to include** | Optional. Click <i class="fal fa-plus" aria-hidden="true"></i> **Add** and enter **From line** and **To line** for a range of rows to extract from. Both ends are included. Leave one end empty for an open range: only **From line** means that line to the end, only **To line** means the start to that line. |
| **Rows to skip** | Optional. Click <i class="fal fa-plus" aria-hidden="true"></i> **Add** and enter **From line** and **To line** for a range of rows to leave out, the same way. |

* Character positions start at `0`; row numbers start at `1`.
* A row that matches both an include and a skip setting is skipped.
* Each value is trimmed of leading and trailing white space, so padding never ends up in the Search Field; a value that is blank after trimming is dropped.
* A line too short for the position and length is skipped without an error.
* The plugin counts characters only, so any separator characters in the line are counted like any other character.
* One expression can hold several positions: click the last <i class="fal fa-plus" aria-hidden="true"></i> **Add** under the row settings to add another **Start position on line** and **Length**. Each position adds its values.
* To read a field at the end of each record, use **Start position from line end**. In Example 2, **Start position from line end** `8` with **Length** `8` returns the dates `20261001`, `20261002`, and `20261003`.

The plugin returns each unique value once (see [How expressions run][]). Configure the plugin in [Add or manage Search Field][] and check the result, including which rows your row settings select, with [Test Your Expression][]. When nothing matches, the test reports *Processed with warning: The Expression yields no result* instead of values:

![Test Expression result: Processed with warning, The Expression yields no result (7.12)][0]  
*The test result when the expression finds no value.*  

### Row Selection

Each **Add** button opens a **From line** / **To line** pair; add one pair per range.

![Rows to include with its Add button (7.12)][3]  
*Rows to include, before a range is added.*  

![Rows to include with From line and To line fields (7.12)][4]  
*A Rows to include range: From line and To line.*  

![Rows to skip with its Add button (7.12)][5]  
*Rows to skip, before a range is added.*  

![Rows to skip with From line and To line fields (7.12)][6]  
*A Rows to skip range: From line and To line.*  

## <i class="fal fa-list-ol" aria-hidden="true"></i> Examples

### Example 1: Extract order numbers at position 4

#### Input

```text
ORD|101|ExampleCompany1|456|Company Name ACME |Dieselgate valley 1|123 45|Flameburg|
ORD|102|ExampleCompany2|789|Company Name MECA |Radiator Spring 420|543 21|Apocalypsenburg|
```

#### Expression

```text
Start position on line = 4
Length = 3
```

#### Result

```text
101
102
```

Positions 0 to 3 hold `ORD|`, so position 4 is where the order number starts. The `|` characters aren't delimiters for this plugin; they are counted as characters.

![Test Expression tab with Type Flat file Fixed width, Start position on line 4 and Length 3; the Result lists 101 and 102 from the two ORD lines in the Message Body (7.12)][2]  
*Start position 4 with Length 3 returns the order numbers 101 and 102.*  

### Example 2: Extract order numbers from padded fixed-width records

#### Input

```text
ORD10001ACME          20261001
ORD10002NORTHWIND     20261002
ORD10001ACME          20261003
```

Each record holds the record type (positions 0–2), the order number (3–7), the customer name padded with spaces (8–21), and the date (22–29).

#### Expression

```text
Start position on line = 3
Length = 5
```

#### Result

```text
10001
10002
```

Order `10001` appears on two lines but is returned once.

![Test Expression tab with Type Flat file Fixed width, Start position on line 3 and Length 5; the Result lists 10001 and 10002 from three fixed-width lines (7.12)][8]  
*Start position `3`, Length `5`: the order numbers, with the duplicate collapsed.*  

### Example 3: Extract padded customer names

Same input as Example 2.

#### Expression

```text
Start position on line = 8
Length = 14
```

#### Result

```text
ACME
NORTHWIND
```

The 14 characters include the padding spaces, which the plugin trims, so users search for `ACME`, not `ACME` followed by ten spaces.

![Test Expression tab with Type Flat file Fixed width, Start position on line 8 and Length 14; the Result lists ACME and NORTHWIND without the padding spaces (7.12)][9]  
*Start position `8`, Length `14`: the padded names come back trimmed.*  

## <i class="fal fa-hand-point-right" aria-hidden="true"></i> Next Steps

* <i class="fal fa-pen-to-square" aria-hidden="true"></i> [Add or manage Search Field][]  
* <i class="fal fa-flask" aria-hidden="true"></i> [Test Your Expression][]  
* <i class="fal fa-eye" aria-hidden="true"></i> [Add or manage Log View][]  

## <i class="fal fa-link-horizontal" aria-hidden="true"></i> Related Topics

* <i class="fal fa-magnifying-glass-plus" aria-hidden="true"></i> [Search Field Expressions][]  
* <i class="fal fa-file-csv" aria-hidden="true"></i> [Flat file CSV][Flat File CSV]  
* <i class="fal fa-spell-check" aria-hidden="true"></i> [RegEx][]  
* <i class="fal fa-function" aria-hidden="true"></i> [Formula][]  
* <i class="fal fa-magnifying-glass" aria-hidden="true"></i> [Search Fields][]  
* <i class="fal fa-message" aria-hidden="true"></i> [Message Types][]  
* <i class="fal fa-table-list" aria-hidden="true"></i> [Log Views][]  

[0]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/NoResult.png
[1]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Flat%20File%20Fixed%20Width/Select.png
[2]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Flat%20File%20Fixed%20Width/Example1.png
[3]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Flat%20File%20Fixed%20Width/IncludeRows_AddButton.png
[4]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Flat%20File%20Fixed%20Width/RowsToIncludeOption.png
[5]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Flat%20File%20Fixed%20Width/ExcludeRows_AddButton.png
[6]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Flat%20File%20Fixed%20Width/RowsToExcludeOption.png
[7]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Expression_FlatFileFixedWidth.gif
[8]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Flat%20File%20Fixed%20Width/Example2.png
[9]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Flat%20File%20Fixed%20Width/Example3.png

[Add or manage Log View]:https://docs.nodinite.com/administration/log-management/log-views/features/add-or-manage-log-view/
[Add or manage Search Field]:https://docs.nodinite.com/administration/log-management/search-fields/features/add-or-manage-search-field/
[Choose a plugin]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/overview/#fa-signs-post-choose-a-plugin
[Flat File CSV]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/flat-file-csv/
[Formula]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/overview/
[How expressions run]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/overview/#fa-gears-how-expressions-run
[Log Event]:https://docs.nodinite.com/core-services/log-event/overview/
[Log Views]:https://docs.nodinite.com/administration/log-management/log-views/features/what-is-a-log-view/
[Message Types]:https://docs.nodinite.com/repository-model/message-types/overview/
[RegEx]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/regex/
[Search Field Expressions]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/overview/
[Search Fields]:https://docs.nodinite.com/administration/log-management/search-fields/features/what-is-a-search-field/
[Test Your Expression]:https://docs.nodinite.com/administration/log-management/search-fields/features/add-or-manage-search-field/#test-your-expression