How to isolate results from a large variable?

Did not word title very well but hope the following explains

I'll have a variable that's built out like the following

A %Tab% B %Tab% C %LineFeed%
D %Tab% E %Tab% F %LineFeed%
H %Tab% I %Tab% J %LineFeed%
K %Tab% L %Tab% M %LineFeed%

I'm looking to do a for each line action where I can isolate the first two items of the line and perform actions for each line. So take A & B perform actions with those, then move on to the next with, D & E, H & I, etc.

What's the best way of doing this?

Search Using regex Expression
see: https://regex101.com
I think this works for you
(.) %Tab% (.) %Tab% . %LineFeed%

(i am new to regex so my code might be improved)

Ah totally forgot about searching with regex, thank you, my fault for not clarifying the question but for anyone searching in the future, the values weren't neccesarily letters so and the it wasn't actually the characters "%Tab%" it was an actual tab space so (.)\t(.) worked for me

First, is your use of "%Tab%" and "%LineFeed%" meant to be literal, or to represent those characters? I'm going to assume you just want the indicated characters, which are represented by "\t" and "\n" in RegEx. I'm also assuming that you don't want two LFs at the end of "line".

So your source data would then be:

A	B	C
D	E	F
H	I	J
K	L	M

which looks like this in BBEdit showing invisible characters:
image

If my assumption was wrong, it is easy enough to fix.

Here's the RegEx to Extract the fields on each line:
(?m)^(.+?)\h+(.+?)\h+(.+?)$

For details, see regex101: build, test, and debug regex

Note that this RegEx is somewhat flexible, in that it will allow multiple TABs and/or multiple SPACEs between the fields.

So here's an example macro to get you started:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Example Results

image

MACRO:   Extract Fields Between Delimiters [Examples]

**Requires: KM 8.2.4+   macOS 10.11 (El Capitan)+**
(Macro was written & tested using KM 9.0+ on macOS 10.14.5 (Mojave))

#### DOWNLOAD Macro File:
<a class="attachment" href="/uploads/default/original/3X/2/8/2830d86e6941fc6e0fa588620c381de5c07741cb.kmmacros">Extract Fields Between Delimiters [Examples].kmmacros</a>
**Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.**


---


<img src="/uploads/default/original/3X/a/9/a9d704d3ac4bf9d34518dd0b3581067c456a04d7.png" width="614" height="1250">

You marked your question as being solved. But I want to contribute a comment.

You said you wanted to perform actions on each line. But you didn't say what those action are. If you tell us what those actions are, there may be a very simple solution, and it may not even require regex at all.