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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:58:20+00:00 2026-06-15T06:58:20+00:00

I have a 200,000 line file that I’m trying to import, but I get

  • 0

I have a 200,000 line file that I’m trying to import, but I get an error:

Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,  : 
  line 39194 did not have 10 elements

Looking at that line with less -N (just type “39000e” to skip to the line you want) I can’t see a difference, so I used split -l 30000 optimized_bail_1127.csv to break it into chunks so I can try importing smaller pieces and appending them (or examining them).

split produces a bunch of files named “xaa”, “xab”, … xag etc. So I want to do something like:

files <- dir(pattern="xa[a-g]")
for(f in files) {
  print (f)
  f <- read.table(f,sep = '|')
}

to get tables for each subfile. I’d also like it to just skip errors (print them, but keep going) so I can at least see how many of these I can import cleanly.

  • 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-15T06:58:23+00:00Added an answer on June 15, 2026 at 6:58 am

    In order to see error messages but keep going in a loop, you can do try():

    FSU <- function() {
           for(i in 1:100){
                if(i == 23) lm(NA~NA)
                }
           print("you made it!")
           }
    
    > FSU()
    Error in terms.formula(formula, data = data) : 
      invalid term in model formula
    

    Using try()

    DontFSU <- function() {
           for(i in 1:100){
                if(i == 23) try(lm(NA~NA))
                }
           print("you made it!")
           }
    
    > DontFSU()
    Error in terms.formula(formula, data = data) : 
       invalid term in model formula
    [1] "you made it!"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a txt file that I’m trying to import as flat file into
I have about 200,000 text files that are placed in a bz2 file. The
I have a CSV file that holds about 200,000 - 300,000 records. Most of
I have a 200 MB text file. But, I need to test my program
I have a file 'records.txt' which contains over 200,000 records. Each record is on
I have 200,000 or more records in an Excel file. If I tried to
I have a large list (over 200,000) of strings that I'd like to compare
I found that I have about 200.000 of png files in my computer during
I have a data set that looks like this: 000 100 200 300 010
i have a table with about 200,000 records. i want to add a field

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.