The Pipeline

Steps you can chain, reorder and edit, with live row counts.

The pipeline is the part of Marlin you will not find elsewhere: a chain of steps you can see, reorder and change, which never touches the source file.

Marlin pipeline
Pipeline on stream.swift, 20 rows. Steps offered: Match, Extract, Bucket, Sort, Unique. Save as Recipe, Run Batch, Write Result. Nothing is written until you export.

Transforms as a Visible Stream (⌥⌘P)

Pipeline is ⌥⌘P. The header is Recipes, Save as Recipe, Run Batch, and Write Result. Add step offers Match, Extract, Bucket, Sort, and Unique. A step can be dragged to a new place in the chain.

Row Counts and Changing a Step

The source card names the file and its row count. On the shot that is stream.swift, 20 rows. The result line under the preview reads how many rows came through and how long the stream took. Match can keep matching rows or drop them.

Marlin pipeline result table
The Result pane numbers every row and reports how many lines were streamed. Nothing is written to disk until Write Result.

The Transform Step

Transform changes each row and keeps every row. Its modes are Replace, Prefix, Suffix, Uppercase, Lowercase, Trim whitespace, Zap gremlins and Strip CR.

Replace takes a parameter in the form pattern => replacement, and the replacement can use $1 for a captured group. Without =>, the matches are removed. Zap gremlins removes control characters, zero-width characters and the byte order mark, and changes no-break spaces to spaces.

Applies to sets Whole line, or one of Field 1 to Field 8 after an Extract step. The other fields stay as they are.

The Select Step

Select keeps or drops fields. Type the field numbers in the order you want them, for example 3, 1, 7. Ranges such as 2-4 also work. Keep listed and Drop listed choose what happens to the fields you name.

Applies to sets how the row is split: tab, whitespace or comma fields. The output fields are tab separated, and the headers keep the names from an earlier Extract step.

Unique Modes

Unique has six modes. Exact and Ignoring case keep the first line of each key. Keep last keeps the last line of each key. Duplicates only keeps keys that appear more than once. Unique only keeps lines whose key appears exactly once. Count writes the count and the line for each key, highest count first.

Applies to adds Regex capture: the key is the first capture group of the pattern, and lines with no match are dropped. Every mode keeps its index on disk, so memory stays flat on a file of any size.

Saving & Re-Running Recipes

Save as Recipe stores the steps as JSON. The Recipes menu loads one back. The button's help is: save these steps as a recipe to reuse on other files. Run Batch can run the same steps over chosen files, every file in a folder, or the files in the current search results.

Write Result

Write Result runs the full pipeline over the whole source and saves the result to a file. While it runs the button reads Running.

Give the file a name that ends in .csv to get CSV. Fields that contain a comma, a quote or a line break are quoted. Any other name writes tab-separated rows.