指定字符行参数🐠meeeyo.com
Scan lines for a marker and return everything after it on that line
- STRING
Here's the workflow shape this node exists for: you've got a batch of text lines that are mostly label: value - and you want the value, but you don't care which line it's on, and you don't want to write a Python node to find it. FindFirstLineContent (指定字符行参数 - "specified-character line parameter") does exactly one thing: it walks the lines top to bottom, finds the first line that contains your marker, and returns everything on that line after the marker.
How it works
Two inputs, both plain strings: input_text (multiline) and target_char. The logic is dead simple - for each line in order, if target_char appears in it, cut the line right after the marker and return the rest. First match wins; anything below never gets read. If nothing matches, you get back an empty string.
So with:
foo: 1
dataa: 42
bar: 3
and target_char = "dataa:" it returns 42. (Yes, the leading space is included - see gotchas below.) Because it matches a containing line rather than an exact line, it shrugs off line-number drift: reorder your text and it still finds the value as long as the marker text is intact. That's the entire appeal.
Where it fits
It's the parsing backbone for the pack's "extract a parameter from text" family. In fact, GetIntParam and GetFloatParam from the same pack are literally this node with type conversion bolted on - same "find the line, take the rest" logic, then int() or float() it. So if you see those in a workflow, this is the raw-string ancestor. Use it for grabbing seeds, ratios, filenames, or any key: value content out of a generated batch.
Install
Part of ComfyUI_StringOps - one install covers the whole pack:
cd ComfyUI/custom_nodes
git clone https://github.com/MeeeyoAI/ComfyUI_StringOps.git
Restart. Or ComfyUI Manager → "ComfyUI_StringOps". No models, no special deps (the pack's requirements.txt is the usual requests/numpy/torch/Pillow/openpyxl). Chinese UI, 🐠meeeyo.com branding, and the node description carries the author's WeChat ad like the rest of the pack.
Common issues
Three things trip people up. Whitespace: whatever comes right after the marker is included verbatim - dataa: + space returns a leading space, and 42 isn't what you wanted to feed an int port. Trim it upstream or include the space in your marker (dataa: ). It's substring, not word, matching: data matches metadata and dataa. If your markers collide, the shorter one wins because it's checked first. First match only: if the marker appears on line 1 as a comment and line 9 as real data, you get the comment. There's no "skip the first N matches" option - for that, the rule-based ExtractSpecificData can target a specific line instead.
Small, sharp, and it earns its keep in any text-driven batch workflow. Just remember it returns the raw string, not a parsed value - the type-casting siblings are a click away.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| input_text | STRING | — | |
| target_char | STRING | 数据a | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |