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

The Archive Base Latest Questions

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

I have a csv file which includes 3 columns, 100+rows. The variables in all

  • 0

I have a “csv” file which includes 3 columns, 100+rows. The variables in all columns change according to the data placed in Column 1, the “Time”.

Time    Temp    Cloud
1100    22  1
1102    14  1
1104    14  2
1106    23  1
1108    12  1
1110    21  2
1112    17  2
1114    12  3
1116    24  3

I want to know when “Cloud” changes [ e.g. at 3rd and 6th row ], and I want to obtain the other variables which is placed at that row, and the row before that row.
How can I do that ?
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-06-15T19:02:31+00:00Added an answer on June 15, 2026 at 7:02 pm

    diff will almost do this directly. Apply it twice. Calling your example data d:

    > d[c(diff(d$Cloud) != 0,FALSE) | c(FALSE, diff(d$Cloud) != 0),]
      Time Temp Cloud
    2 1102   14     1
    3 1104   14     2
    4 1106   23     1
    5 1108   12     1
    6 1110   21     2
    7 1112   17     2
    8 1114   12     3
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Little Background: I have csv file which has lots of rows and each row
I have a csv file which may have empty or blank rows. I want
I have a System.Data.DataTable which is populated by reading a CSV file which sets
I have a csv file which has two columns, a numeric ID ( IDVAR
For example, I have a variable $foo that includes all the data which I
I have a csv file which has 3 columns. I am trying to search
I have a CSV file which has a column for time and the time
I have a csv file which contains a column named query. One of the
I have a CSV file which has the following format: id,case1,case2,case3 Here is a
Possible Duplicate: Prepend lines to file in Java I have a CSV-file which supports

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.