Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6919505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:59:55+00:00 2026-05-27T09:59:55+00:00

I am trying to put together what I thought would be an easy solution

  • 0

I am trying to put together what I thought would be an easy solution for a friend.

He has a list of fan emails that he collects at gigs and off his website.

He sticks them in a single column file and saves them.

He needs to have them in comma delimited format containing 150 each, one single line.

He wants a “simple” local HTML form he can paste the list into and have the results displayed.

So, I started working on it but, it has proven past my ability.

So far I have some basics but, I really need help.
As you can see, I am really a beginner.

     <html><head>
        <script type="text/javascript">

        function makeit(){

        var enteredEmails = document.getElementById("emails").value;
        var cnt = document.getElementById("breakcnt").value;
        var mails = enteredEmails.toString();
        var textareacnt = '1';

        // Now I think I need to loop or create arrays of emails up to cnt //

        csvmails = mails.splice(0,cnt)

        // Then dynamically generate some textareas or boxes populated with a single comma delimited line of  cnt" emails //

 document.write("<textarea id=\"textareacnt\">" + csvmails + "</textarea>")

 textareacnt++; 

        }
        </script>
        </head><body>
        <form onsubmit="makeit();">
        <textarea name="emails" id="emails" rows="10" cols="75"></textarea><br />
        <input type="text" name="breakcnt" id="breakcnt"><br />
        <input type="submit" name="submit" value="submit">
        </form>
    <textarea id="results"></textarea>
        </body></html>

The textarera will have emails pasted into it like:

amail1@sometld.com
bmail1@sometld.com
cmail1@sometld.com
amail4@sometld.com
zmail10@sometld.com

… up to 6000 fan emails he has collected over the years

He needs the results to be:

amail1@sometld.com,bmail1@sometld.com,cmail1@sometld.com,amail4@sometld.com,zmail10@sometld.com

up to 150 emails long as I am sure the last chunk or array will not contain 150.

I cant get anything to work and I spent 6 hours on this so far.

Can someone please help? I feel like a complete idiot.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T09:59:56+00:00Added an answer on May 27, 2026 at 9:59 am

    All you have to do is split the text into an array and then splice the array in a loop and join the slices you take out like this:

    var emails= document.getElementById('emails').value.split(/\s+/), list="";
    while(emails.length) {
      list+=emails.splice(0,150).join(',')+"\n";
    }
    //list now has the result you are looking for
    

    I have made an example of how to this here: http://jsfiddle.net/PfB42/2/

    All you have to do is paste the emails into the text area and it will automatically change the format to the one you are looking for, and insert it to the <pre> area below the textarea

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to put together a page that has a header that spans
I'm trying to put together an app for fun that has a scenario where
I trying to put together an Android app that will take a picture and
We're trying to put together kiosk solution where we can charge people by hour
I'm trying to put together a simple RSS widget (for my wordpress blog) that
I am trying to put together a query that will display one specific record
I am trying to put together a mysql query, that links 3 tables together.
I was trying to put together a solution to: Insert spaces between words on
I'm trying to put together a MYSQL query that will count the number of
I'm trying to put together an association that takes advantage of Mongo's document subkey

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.