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 8449019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:35:09+00:00 2026-06-10T10:35:09+00:00

It would be preferable if the code is able to create a new file.

  • 0

It would be preferable if the code is able to create a new file.
eg: If my file originally is:
fsyfugiuhknklmoiuiuutyughvhjbiuhi
jhiubuguygfvtdrcrsresetgfcyuhijoj

and the new file desired contains a new line char after every 3rd position:
fsy
fug
iuh
knk
…

what should be the code.?

  • 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-06-10T10:35:11+00:00Added an answer on June 10, 2026 at 10:35 am
    void InsertACharacterNoStringAfterEveryNCharactersInAHugeTextFileUsingCSharp(
        string inputPath, string outputPath, int blockSize, string separator)
    {
        using (var input = File.OpenText(inputPath))
        using (var output = File.CreateText(outputPath))
        {
            var buffer = new char[blockSize];
            int readCount;
            while ((readCount = input.ReadBlock(buffer, 0, buffer.Length)) > 0)
            {
                output.Write(buffer, 0, readCount);
                if (readCount == buffer.Length)
                    output.Write(separator);
            }
        }
    }
    
    // usage:
    InsertACharacterNoStringAfterEveryNCharactersInAHugeTextFileUsingCSharp(
        inputPath, outputPath, 3, Environment.NewLine);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For the purposes of code review, after an existing source file is modified, we
I would like to know what performs faster and its preferable a condition in
Would like to parse IPv4 address from exit-addresses . Format of the file: ExitNode
What would be the easiest way to create a C compiler for a custom
Basically I want to be able to call jQuery from FireBug, place code that
I have the following line of PHP code which works great: exec( 'wget http://www.mydomain.com/u1.php
After the window containing GLUT graphics appears, I would like to enter input in
I'm trying to create some code that is very user friendly to someone not
I need to retrieve the date from a UIDatePicker (Preferably I would also like
I want to write a program to hash some data and preferably i would

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.