Pages

Copy rows from one spreadsheet to new one based on columns in a spreadsheet

If we want to copy  the rows from one spreadsheet to a new file based on values in another file, for example we have the files listed below.


                   
                                                File1                                                                                File2



    If we want to create a new file which has the rows of File1 only for those ids which are present in file2 we can use the following pyoo script.

Steps for installation of pyoo has been given here.

Before executing the script, we have to ensure that libreoffice is listening to the pyoo by running the following command


In the script below, file1points to the file with source data ,file2 points to the file which has the reference values based on which we want to copy and copy points to the file which will be created. Update the paths respectively.



Save the script as create_copy.py and execute it.



We should see the following file by the name given in the copy path.



No comments:

Post a Comment