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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:25:10+00:00 2026-05-14T18:25:10+00:00

I have to handle TXT dat files which coming from one embed device, My

  • 0

I have to handle TXT dat files which coming from one embed device, My problem is in that device always sending all captured data but I want to take only difrences between two sending and do calculation on them. After calculation I send it to SQL using bulkinsert function. I want to extract data which is different according to first file I got from device. Lats say that device first time device send data like this in some.dat (ASCII) file

0000199991
0000199321
0000132913
0000232318
0000312898

On second calls to get data from device it is going to return all again (previous and next captured records) something like this

0000199991
0000199321
0000132913
0000232318
0000312898
9992129990
8782999022
2323423456

But this time I do want only to calculate and pass trough data added after first insert.
I am trying to make Win Forms app using C# and Visual Studio 2008

  • 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-14T18:25:11+00:00Added an answer on May 14, 2026 at 6:25 pm

    You can do this using LINQ:

    string[] addedLines = File.ReadAllLines(secondPath)
                              .Except(File.ReadAllLines(firstPath))
                              .ToArray();
    

    Note that this will be slow for large files.

    For large files, replace ReadAllLines with the following method: (In .Net 4, you can use File.ReadLines instead)

    static IEnumerable<string> EnumerateLines(string path) {
        using(var reader = File.OpenText(path)) {
            string line;
            while(null != (line = reader.ReadLine())
                yield return line;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

UPDATE : I have found the problem that my DP solution didn't handle bonus
I have a directory which has say 10 .txt files. Open the directory using:
I have an app in which I parse a .txt file from a URL
I have an Attachment model, which is using Paperclip to handle uploaded files. The
I need guideline about using of robots.txt problem is as following. I have one
I have a folder with two files: Awesome.File.20091031_123002.txt Awesome.File.Summary.20091031_123152.txt Additionally, a third-party app handles
I have a UIViewController subclass that I am trying to have handle the shake
I have the handle of process 'A' on a Pocket PC 2003 device. I
I have a PHP application that will on occasion have to handle URLs where
just a general question, do you ALWAYS have to handle error? i was just

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.