Line Processing

Batch add prefix/suffix and line numbers; remove or keep lines containing keywords

Batch line processing: prefixes, suffixes, line numbers, and keyword filtering

Five actions run in a fixed order

One run of this tool applies changes in this exact sequence: filter by keyword first, then add prefix and suffix, and finally add line numbers. The order is not cosmetic — it changes what you get back:

The point is that filtering reshapes the list, and numbering reflects the reshaped list. Keep that in mind whenever the output is going to be cited elsewhere.

How keyword filtering actually works

Both filter boxes are substring includes matches — not regular expressions, not whole-line matches — and they are case-sensitive. A few practical judgments:

GoalKeywordNote
Keep only error lineskeep containing ERRORAll-caps log levels are usually reliable
Drop comment linesremove containing #Inline comments are also dropped, because this is substring matching
Drop blank linesremove containing (a single space)Unreliable: a blank line made only of tabs will not match; use the empty-line toggle in the dedupe tool instead
Drop a specific wordremove containing that wordSubstring matching means cat also hits category

The last two rows show the classic trap of substring matching. The shorter the keyword, the more false hits you get. After filtering, scan the result once before trusting it — discovering missing data afterwards is far more expensive than a quick glance.

If both filter boxes are filled, deletion runs first and keeping runs second. The sensible pattern is "delete the obviously irrelevant bulk first, then keep what you care about".

Typical uses for prefix and suffix

Safety note when generating SQL or code: literals built this way are fine for local data wrangling and one-off scripts. Never concatenate user input into SQL this way and then execute it — that is the textbook SQL injection entry point. In real programs, values must go through parameterized queries (placeholders), never string concatenation.

How this tool relates to its neighbours

NeedUse
Add prefix/suffix/line numbers, filter by keywordThis tool
Remove duplicate rows, sortLine dedupe and sort
Replace text by patternFind and replace
Strip leading/trailing whitespace, normalize newlinesWhitespace cleaner

How to use it

Paste one item per line, fill the prefix, suffix, and keywords as needed, tick "add line numbers", and click process. Everything runs locally in your browser — logs and configs routinely contain tokens, internal addresses, and user data, so local processing is a necessary default, not a nice-to-have.

If the log is huge, shrink the scope with a keyword first rather than pasting hundreds of thousands of lines into the browser.

FAQ

Can remove and keep be used together?

Yes. First filter out unwanted lines by "Remove containing", then further filter by "Keep only containing"; the two stack.

Are line numbers based on pre- or post-processing order?

Line numbers are assigned based on the current line order after filtering and adding prefix/suffix, matching the final output.