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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:42:06+00:00 2026-05-17T21:42:06+00:00

I have a relatively large csv files (1.2gb… large to the 2gb RAM on

  • 0

I have a relatively large csv files (1.2gb… large to the 2gb RAM on one of my computers). To every entry in one column I would like to append “1C” so that I can join/merge with another dataframe/db table.

If the file weren’t so large, it would be easy to use read.csv to import to data then use data$symbol <- paste(data$symbol, "1C", sep=""). But now I get the can't allocate vector of size x warning.

Is a manual solution, like scan(), my only option? (I’m a bit afraid of corrupting my data) 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-17T21:42:07+00:00Added an answer on May 17, 2026 at 9:42 pm

    Using scan isn’t going to help if you can already get your data into R.

    Make sure data only has the columns you need to merge, and run gc() before you try your paste command (gc will help if you’re near the margin of your memory limit).

    If that fails, look at some of the solutions in this thread.


    UPDATE:
    And if you happen to be using a flavor of *nix, or if you have Rtools installed on windows, you could do this with gawk. If your data are in foo.csv and you want to add the “C1” to the second column, this will create a new file, bar.csv, with “C1” appended to the second column.

    compy: /home/josh
    > cat foo.csv 
    1,one,2,two
    3,three,4,four
    5,five,6,six
    
    compy: /home/josh
    > gawk -F "," '{OFS=","; $2=($2 "1C"); print}' < foo.csv > bar.csv
    
    compy: /home/josh
    > cat bar.csv 
    1,one1C,2,two
    3,three1C,4,four
    5,five1C,6,six
    

    This will likely be faster than R and will consume a negligible amount of memory.

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

Sidebar

Related Questions

I have some relatively large legacy method that I would like to refactor. It
I have a need to run a relatively large number of virtual machines on
I have a relatively simple form which asks a variety of questions. One of
I have two groups of files that contain data in CSV format with a
We have a relatively large application that is strongly tied into Firebird (stored procedures,
I have a relatively large database tables (just under a million rows) that has
I have a relatively large strings that will not change during my program run.
I have a relatively large dataset of items (a few thousand items) that I
I have a relatively large C#/WPF Visual Studio 2008 solution that I am trying
I have a relatively large script in GreaseMonkey and it seems to be crashing

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.