Jump to content

Script/Formula for Comparing/Editing 2 Spreadsheets

Go to solution Solved by RedWulf,
1 minute ago, Enderman said:

i know programs that can do that for text files, but idk about spreadsheets

csv is a text file essentially unless you mean it is only string/column based. Comma separated value format, which is how many programs store spread sheets and it is nearly readable. Change some syntax(commas) and some parameters to this and it would be csv. 

2 minutes ago, MoraisGT said:

 

10076     john      john.stevens    john.stevens@domain.com

I work in excel usually, but I imagine libre has some options

see if this topic helps. There are some more complex data base programs and some programming option but that seems excessive for this task. 

http://stackoverflow.com/questions/6709225/merging-data-in-open-libreoffice-calc

 

Hi guys!

I work with libreoffice and I have two .csv files containing information like: person name, email adress, login etc.

 

One of these files was pulled from an AD machine and needs to be updated with the information from the other file.

 

There are more than 200 records and it would be extremely time consuming comparing/updating the files manually, one record after another.

 

Do you know any formula/script that would allow this to happen: If "x" email from file 1 exists on file 2, then update file 2 with the entire row from file 1. Meaning if the email "john@domain.com" exists on both files than update file 2's information with the row from file 1.

 

Thank's in advance.

 

-MoraisGT

Link to post
Share on other sites

i know programs that can do that for text files, but idk about spreadsheets

NEW PC build: Blank Heaven   minimalist white and black PC     Old S340 build log "White Heaven"        The "LIGHTCANON" flashlight build log        Project AntiRoll (prototype)        Custom speaker project

Spoiler

Ryzen 3950X | AMD Vega Frontier Edition | ASUS X570 Pro WS | Corsair Vengeance LPX 64GB | NZXT H500 | Seasonic Prime Fanless TX-700 | Custom loop | Coolermaster SK630 White | Logitech MX Master 2S | Samsung 980 Pro 1TB + 970 Pro 512GB | Samsung 58" 4k TV | Scarlett 2i4 | 2x AT2020

 

Link to post
Share on other sites

7 minutes ago, Enderman said:

i know programs that can do that for text files, but idk about spreadsheets

But those programs would only compare lines with one string correct?

 

Because if I copy the information from one of these files to a text file it would look like something like this:

 

10076     john      john.stevens    john.stevens@domain.com

 

 

It wouldn't work like this would it?

Link to post
Share on other sites

1 minute ago, Enderman said:

i know programs that can do that for text files, but idk about spreadsheets

csv is a text file essentially unless you mean it is only string/column based. Comma separated value format, which is how many programs store spread sheets and it is nearly readable. Change some syntax(commas) and some parameters to this and it would be csv. 

2 minutes ago, MoraisGT said:

 

10076     john      john.stevens    john.stevens@domain.com

I work in excel usually, but I imagine libre has some options

see if this topic helps. There are some more complex data base programs and some programming option but that seems excessive for this task. 

http://stackoverflow.com/questions/6709225/merging-data-in-open-libreoffice-calc

 

                     .
                   _/ V\
                  / /  /
                <<    |
                ,/    ]
              ,/      ]
            ,/        |
           /    \  \ /
          /      | | |
    ______|   __/_/| |
   /_______\______}\__}  

Spoiler

[I5-12600k | 32gb DDR5 6000 | RTX5070 | 2x1tb M.2]

 

[Ryzen 5 1600 | 16gb DDR4 3200 | GTX1030 | 4x 8tb HDD] 

 

Link to post
Share on other sites

23 minutes ago, MoraisGT said:

But those programs would only compare lines with one string correct?

 

Because if I copy the information from one of these files to a text file it would look like something like this:

 

10076     john      john.stevens    john.stevens@domain.com

 

 

It wouldn't work like this would it?

those programs would show the differences between multiple files

NEW PC build: Blank Heaven   minimalist white and black PC     Old S340 build log "White Heaven"        The "LIGHTCANON" flashlight build log        Project AntiRoll (prototype)        Custom speaker project

Spoiler

Ryzen 3950X | AMD Vega Frontier Edition | ASUS X570 Pro WS | Corsair Vengeance LPX 64GB | NZXT H500 | Seasonic Prime Fanless TX-700 | Custom loop | Coolermaster SK630 White | Logitech MX Master 2S | Samsung 980 Pro 1TB + 970 Pro 512GB | Samsung 58" 4k TV | Scarlett 2i4 | 2x AT2020

 

Link to post
Share on other sites

19 minutes ago, RedWulf said:

csv is a text file essentially unless you mean it is only string/column based. Comma separated value format, which is how many programs store spread sheets and it is nearly readable. Change some syntax(commas) and some parameters to this and it would be csv. 

I work in excel usually, but I imagine libre has some options

see if this topic helps. There are some more complex data base programs and some programming option but that seems excessive for this task. 

http://stackoverflow.com/questions/6709225/merging-data-in-open-libreoffice-calc

 

With a slow read I'm starting to understand what that function does, I think it might work for my case, although it's going to be a bit tricky because, the two files are not organized in the same way and do not have the same columns. I'll have to think about how I'm going to do this :P

 

But the info in the link you provided definitely helped ;)

 

Link to post
Share on other sites

6 minutes ago, Enderman said:

those programs would show the differences between multiple files

I see, that would be a little easier, but I would still need to edit each updated record manually....that would take ages :D

Link to post
Share on other sites

1 minute ago, MoraisGT said:

With a slow read I'm starting to understand what that function does, I think it might work for my case, although it's going to be a bit tricky because, the two files are not organized in the same way and do not have the same columns. I'll have to think about how I'm going to do this :P

 

But the info in the link you provided definitely helped ;)

 

I imagine its not the last time you'll need to consolidate spreadsheets, so learning the concept and pattern should serve you well. 

There are some other threads and blogs explaining it all over google, best of luck to you

                     .
                   _/ V\
                  / /  /
                <<    |
                ,/    ]
              ,/      ]
            ,/        |
           /    \  \ /
          /      | | |
    ______|   __/_/| |
   /_______\______}\__}  

Spoiler

[I5-12600k | 32gb DDR5 6000 | RTX5070 | 2x1tb M.2]

 

[Ryzen 5 1600 | 16gb DDR4 3200 | GTX1030 | 4x 8tb HDD] 

 

Link to post
Share on other sites

10 minutes ago, RedWulf said:

I imagine its not the last time you'll need to consolidate spreadsheets, so learning the concept and pattern should serve you well. 

There are some other threads and blogs explaining it all over google, best of luck to you

One cannot have too much knowledge :D

 

 

From the link you gave me I came up with this: =VLOOKUP(A2,$Sheet2.$D$2:$D$140,1,0)

 

That function from what understand is doing the following:

Search the content of cell A2 (of current spredsheet) from cells D2 to D140 of the second spreadsheet and if it matches then return that value. Correct?

 

It's basically confirming if the name of a person on spreadsheet 1 is also on spreadsheet 2 right?

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×