Skip to content

Generate multiple lines at once #105

Open

Description

@matthewmayer

Would be nice to do something like

npx faker -n 100 email > emails.txt
cat emails.txt | sort

Activity

  1. xDivisionByZerox commented on Jan 5, 2026

    @xDivisionByZerox
    Member

    You can achieve this by other shell commands.

    Workaround (as a one liner):

    for i in {1..100}; do faker email | sed 's/$/\n/' >> emails.txt; done
    Explanation
    • for i in {1..100}; do ...; done - loops for 100 iterations
    • faker email | - creates a random email using faker and pipes the output to the next command
    • sed 's/$/\n/' - append a new line character to the output, to separate the emails by line
    • >> emails.txt - append the final result to the file "emails.txt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions