Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

interleave

Insert a custom string after every n-th line of a text file. The tool always writes to a new .txt file (never overwrites by default). If the target name exists, it appends a numeric suffix (e.g., .1, .2, …).

Features

  • Insert any string (--sep) after every n-th line (--nth)
  • Optional trailing insert at EOF (--include-trailing)
  • Safe output: new file is created automatically (e.g., input.interleaved.txt; or output.txt, output.1.txt, …)
  • Optional --stdout to also print the result

Install

Requires Python 3.8+.

chmod +x interleave.py

Usage

./interleave.py INPUT_FILE [--sep "STRING"] [--nth N] [--include-trailing] [--outfile OUTPUT_FILE] [--stdout]

Arguments

  • INPUT_FILE — Source .txt
  • --sep — String to insert (default: ---)
  • --nth — Insert after every n-th line (default: 1)
  • --include-trailing — Also insert at EOF if the last group ends exactly on a multiple of n
  • --outfile — Desired output file path (a new file is created; numeric suffix added if it exists)
  • --stdout — Also print the transformed text to stdout

Examples

Every 2nd line, default output name:

./interleave.py input.txt --sep " | " --nth 2
# -> writes input.interleaved.txt (or input.interleaved.1.txt if needed)

Every 3rd line with trailing insert, custom filename:

./interleave.py input.txt --sep "***" --nth 3 --include-trailing --outfile chunked.txt
# -> writes chunked.txt (or chunked.1.txt if needed)

Also print to terminal:

./interleave.py input.txt --sep "<SEP>" --nth 5 --stdout

About

Script to quickly interleave a string into a wordlist at every nth line - useful for making auth attack wordlists when needing to bypass auth with rate limiting which resets after a successful login

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages