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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:43:02+00:00 2026-06-15T22:43:02+00:00

Setting: I have (simple) .csv and .dat files created from laboratory devices and other

  • 0

Setting:
I have (simple) .csv and .dat files created from laboratory devices and other programs storing information on measurements or calculations. I have found this for other languages but nor for R

Problem:
Using R, I am trying to extract values to quickly display results w/o opening the created files. Hereby I have two typical settings:

a) I need to read a priori unknown values after known key words
b) I need to read lines after known key words or lines

I can’t make functions such as scan() and grep() work.

c) Finally I would like to loop over dozens of files in a folder and give me a summary (to make the picture complete: I will manage this part)

I woul appreciate any form of help.

  • 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-15T22:43:03+00:00Added an answer on June 15, 2026 at 10:43 pm

    ok, it works for the key value (although perhaps not very nice)

     variable<-scan("file.csv", what=character(),sep="")
    

    returns a charactor vector of everything

     variable[grep("keyword", ks)+2]     # + 2 as the actual value is stored two places ahead
    

    returns characters of seaked values.

     as.numeric(lapply(variable, gsub, patt=",", replace="."))
    

    for completion: data had to be altered to number and “,” and “.” problem needed to be solved.

    in a line:
    data=as.numeric(lapply(ks[grep(“Ks_Boden”, ks)+2], gsub, patt=”,”, replace=”.”))

    Perseverence is not to bad of an asset 😉

    The rest isn’t finished, yet, I will post once finished.

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

Sidebar

Related Questions

I have created simple .NET Web Service (ASMX) that I call from my .NET
I have simple issue setting a two-way databinding of a checkbox in Silverlight 3.0.
I am setting up a simple test page in Python. I only have two
I have problems setting the focus on an input element that has been created
I have simple SQL string like this: SELECT * FROM Office WHERE OfficeId IN
I have a simple application with a UI with a backend connection, from which
I want to have an ASP C# WebSite that loads a simple CSV File
I have a simple php page which outputs a table (which has been created
I have a simple nested form and I am setting a nested attribute with
So I have this simple fiddle with 3 lists that expand by setting each

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.