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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:47:30+00:00 2026-05-18T09:47:30+00:00

I have five text files that are produced by an R program, (each of

  • 0

I have five text files that are produced by an R program, (each of them having header) that are to be combined into a single file. I have combined them using rbind and my problem is when I combine them, the resultant output has headers attached at end of each file for example,
if the headers are supposed

Combine Resultant file
A  B  C  D
1  3  5  7    ------------> Text file1
6  9  0  3
A  B  C  D
1  3  6  7    ------------> Text file 2
5  7  8  3
and so on....

instead of that I want the output file to have only one header at line 1
so the file should look like:

Combine Resultant file
A  B  C  D
1  3  5  7    ------------> Text file1
6  9  0  3
1  3  6  7    ------------> Text file 2
5  7  8  3
and so on....

Can anyone tell me how to do that?
The code I have is:

S1 <- read.table("C:/Simulation_Results/sim_1_200.txt",sep=";",header= TRUE);
S2 <- read.table("C:/Simulation_Results/sim_201_400.txt", sep=";",header= TRUE);
S3 <- read.table("C:/Simulation_Results/sim_401_600_b.txt", sep=";",header= TRUE);
S4 <- read.table("C:/Simulation_Results/sim_601_800.txt", sep=";",header= TRUE);
S5 <- read.table("C:/Simulation_Results/sim_901_1000.txt",sep=";",header= TRUE);
S6 <- read.table("C:/Simulation_Results/simulations_801_900.txt",sep=";",header= TRUE);
options(max.print=28.5E6);
S7 <- rbind(S1,S2,S3,S4,S5,S6)
write.table(S7, file="C:/Simulation_Results/simulation_1_1000.txt", sep=";", 
            row.names=TRUE, col.names=FALSE, quote = FALSE);

Thanks!

  • 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-18T09:47:31+00:00Added an answer on May 18, 2026 at 9:47 am

    This sounds like an improper import. You should provide an example data. Anyway, instead of using read.table("some.file", header=TRUE, sep=";"), give read.csv2 a try, since it has header=TRUE and sep=";" as default arguments.

    And instead rbind, why don’t you use merge?

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

Sidebar

Related Questions

I have five text files that need to be loaded into memory. I set
I have a rather large text file that has a bunch of missing newlines,
Assume you have five products, and all of them use one or more of
I have a solution consisting of five projects, each of which compile to separate
On a Linux system, I have a very large text file and I need
I have a text file with up to 100 IP addresses, 1 per line.
What are the key differences between Flash and Flex? I have over five years
I have the following five tables: ISP Product Connection AddOn AddOn/Product (pivot table for
I have a Div with five float divs inside: var div=document.createElement(div); div.className=cssDivNino; var divFolio=document.createElement(div);
I have a set of five boolean values. If more than one of these

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.