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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:17:49+00:00 2026-05-25T10:17:49+00:00

I open two files into 2 seperate DGVs.. Once opened and the button Format

  • 0

I open two files into 2 seperate DGVs.. Once opened and the button “Format” is clicked, it matches all of the lines in the two seperate DGVs and copies it into a new DGV.

The first DGV looks like this (column labels):

Name    P/N    X    Y    Rotation    PkgStyle

and the second DGV looks like this:

PkgStyle    P/D   Feeder    Vision    Speed    Machine    Width    Time

The two files will match the PkgStyle and concat the rest of the lines together to get the third DGV that looks like this:

Name    P/N    X    Y    Rotation    PkgStyle    PkgStyle    P/D   Feeder    Vision    Speed    Machine    Width    Time

Now, as you may expect there could be possible lines that do not match properly and will not combine the two sets of lines from the two files. If this is the case it will only input the information from the first file and not the second.

So some sample data might look like this:

Name    P/N    X    Y    Rotation    PkgStyle    PkgStyle    P/D   Feeder    Vision    Speed    Machine    Width    Time
J11     1234   12  7     180         9876         9876    THETHING   1        1           1        UNI      12MM     1MS
R90     2222   19  9     0           1255         1255    ITEM       2        1           1        UNI2     5MM      1MS
J18     9845   11  4     270         456
C127    1111   05  1     270         5555         5555    ITEM2      3        1           1        UNI      8MM      0.1MS

SO

The third row (not including the titles of the columns) has blank cells in it. When the user changes the cell data in those blank spots, I would like to add it to a text document that already contains similar data. So, if the user added 456 someITEM 4 1 1 UNI2 9MM 10MS to the DataGridView lines that were blank, I want to add that to the end of the a file that already contains data. I want to only add the line if all of the column cells are filled in for each row. The output can just be space delimited.

Can anyone help me with this?

  • 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-25T10:17:50+00:00Added an answer on May 25, 2026 at 10:17 am
    foreach (var line in theList)
    {
        string pkgStyleNA, PDNA, feederNA, visionNA, speedNA, machineNA, widthNA, timeNA;
    
        if (line.PkgStyle.Equals(string.Empty))
            pkgStyleNA = "N/A ";
        else
            pkgStyleNA = line.PkgStyle;
    
        if (line.PD.Equals(string.Empty))
            PDNA = "N/A ";
        else
            PDNA = line.PD;
    
        if (line.Feeder.Equals(string.Empty))
            feederNA = "N/A ";
        else
            feederNA = line.Feeder;
    
        if (line.Vision.Equals(string.Empty))
            visionNA = "N/A ";
        else
            visionNA = line.Vision;
    
        if (line.Speed.Equals(string.Empty))
            speedNA = "N/A ";
        else
            speedNA = line.Speed;
    
        if (line.Machine.Equals(string.Empty))
            machineNA = "N/A ";
        else
            machineNA = line.Machine;
    
        if (line.Width.Equals(string.Empty))
            widthNA = "N/A ";
        else
            widthNA = line.Width;
    
        if (line.Time.Equals(string.Empty))
            timeNA = "N/A ";
        else
            timeNA = line.Time.ToString();
    
        addToDataBase.Add(pkgStyleNA + " " + PDNA + " " + feederNA + " " + visionNA + " " + speedNA+ " " + machineNA+ " " + widthNA + " " + timeNA);
    }
    
    using (StreamWriter outFile = new StreamWriter(openDataBaseFile.FileName, true))
    {
        outFile.WriteLine();
    
        var noDuplicatesList = addToDataBaseList.Distinct().ToList();
        foreach (var item in noDuplicatesList)
            outfile.WriteLine(item);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to open these two files and read their contents into two
These two files are mostly seen in open source projects. What are they for,
I am trying to merge two or more postscript files into one. I tried
How does one combine two GCC compiled .o object files into a third .o
Is it possible to take two files that are open in separate tabs in
I'm trying to add two image files into the solution, so they will be
I have two nib files, one that will open at startup and another that
Is it possible to open the same file in two separate windows in Xcode.
I have an odd need to open two separate instances of excel and having
What I'm trying to do with FileStream in C#/.NET is to open two streams:

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.