{"id":"019edb1e-cc2e-7548-87fa-f75e344289b2","number":1,"ts":1781793960002,"task":"I want you to write a script which takes data from a source file and pastes it into the template and save it as a new file. \n\n# source and template files\nIn the folder is a source file \"Production Order (mrp.production).xlsx\" and a template \"A4004_v3.0-260617.ods\". \nThe source file always varies, therefore I have included three more source files as examples: Production Order (mrp.production)(1).xlsx; Production Order (mrp.production)(2).xlsx; Production Order (mrp.production)(3).xlsx.\nThe script should dynamically find cells in the source file and match them to cells in the template.\n\n# assign cells, rows and columns\nAs all source files differ slightly, cell coordinates have to be handled differently.\nIn the source file, column \"D\" contains the \"Category\" of each individual Part from row 2 onwards.\nIn the source file, column \"E\" contains the \"Name\" of each individual Part.\nIn the source file, column \"G\" contains the \"Part-Serialnumber\" of each individual Part.\nIn the source file, column \"G\" there may be more than one Part-Serialnumber listed for each category.\nIn the template file, column \"B\" contains the \"Category\" of each indivirual Part from row 10 onwards.\nIn the template file, column \"C:D\" contains the \"Name\" of each indivirual Part from row 10 onwards.\nIn the template file, column \"E\" contains the \"Part-Serialnumber\" of each indivirual Part from row 10 onwards.\nIn the source file, \"All / Components / Barebone\" relates to \"Barebone\" in the template.\nIn the source file, \"All / Components / CPU\" relates to \"CPU\"  in the template.\nIn the source file, \"All / Components / RAM\" relates to \"Speicher\" in the template.\nIn the source file, \"All / Components / GPU\" relates to \"GPU\" in the template. \nIn the source file, \"All / Components / SSD\" relates to \"NVME U.2\" in the template.\nIn the source file, \"All / Components / Network\" relates to \"NIC\" in the template.\nIn the source file, \"All / Components / RAID\" relates to \"RAID\" in the template.\n\n# set variables\ncreate integer variable \"mGPU\" and set it to 0.\ncreate integer variable \"mRAM\" and set it to 0.\ncreate integer variable \"mSSD\" and set it to 0.\ncreate integer variable \"mGPU\" and set it to 0.\nIn the source file, if the cell below \"All / Components / GPU\" is empty, increase an integer-variable \"mGPU\" by 1 and move down one cell. Then if the next cell below is empty, increase an integer-variable \"mGPU\" by 1 and move down one cell. Repeat this until the cell below is not empty.\nIn the source file, If the cell below \"All / Components / RAM\" is empty, increase an integer-variable \"mRAM\" by 1 and move down one cell. Then if the next cell below is empty, increase an integer-variable \"mGPU\" by 1 and move down one cell. Repeat this until the cell below is not empty.\nIn the source file, If the cell below \"All / Components / SSD\" is empty, increase an integer-variable \"mSSD\" by 1 and move down one cell. Then if the next cell below is empty, increase an integer-variable \"mGPU\" by 1 and move down one cell. Repeat this until the cell below is not empty.\nIn the source file, If the cell below \"All / Components / NIC\" is empty, increase an integer-variable \"mNIC\" by 1 and move down one cell. Then if the next cell below is empty, increase an integer-variable \"mGPU\" by 1 and move down one cell. Repeat this until the cell below is not empty.\n\n# copy Component Name\nIn the source file, look for a cell containing \"All / Components / Barebone\", copy the content in the cell to it's right and paste it into cell \"C10:D10\" in the template.\nIn the source file, look for a cell containing \"All / Components / CPU\", copy the content in the cell to it's right and paste it into cell \"C11:D11\" in the template.\nIn the source file, look for a cell containing \"All / Components / RAM\", copy the content in the cell to it's right and paste it into cell \"C12:D19\" in the template.\nIn the source file, look for a cell containing \"All / Components / GPU\", copy the content in the cell to it's right and paste it into cell \"C20:D23\" in the template.\nIn the source file, look for a cell containing \"All / Components / SSD\", copy the content in the cell to it's right and paste it into cell \"C24:D26\" in the template.\nIn the source file, there might be a second cell containing \"All / Components / SSD\" with different content in the cell to it's right. this should be pasted into cell \"C27:D29\" in the template.\nIn the source file, look for a cell containing \"All / Components / Network\", copy the content in the cell to it's right and paste it into cell \"C30:D30\" in the template.\nIn the source file, there might be a second cell containing \"All / Components / SSD\" with different content in the cell to it's right. this should be pasted into cell \"C31:D31\" in the template.\nIn the source file, look for a cell containing \"All / Components / RAID\", copy the content in the cell to it's right and paste it into cell \"C32:D32\" in the template.\n\n# copy Part-Serialnumber\nIn the source file, in row of \"All / Components / Barebone\" copy the Part-Serialnumber in column \"G\" to cell \"E10\" in the template. \nIn the source file, in row of \"All / Components / CPU\" copy the Part-Serialnumber in column \"G\" to cell \"E11\" in the template.\nIn the source file, in row of \"All / Components / RAM\" copy the Part-Serialnumber in column \"G\" to cell \"E12\" in the template.\nIf the variable \"mRAM\" is greater than 1, copy the next Part-Serialnumber in column \"G\" to cell \"E13\" in the template.\nIf the variable \"mRAM\" is greater than 2, copy the next Part-Serialnumber in column \"G\" to cell \"E14\" in the template.\nIf the variable \"mRAM\" is greater than 3, copy the next Part-Serialnumber in column \"G\" to cell \"E15\" in the template.\nIf the variable \"mRAM\" is greater than 4, copy the next Part-Serialnumber in column \"G\" to cell \"E16\" in the template.\nIf the variable \"mRAM\" is greater than 5, copy the next Part-Serialnumber in column \"G\" to cell \"E17\" in the template.\nIf the variable \"mRAM\" is greater than 6, copy the next Part-Serialnumber in column \"G\" to cell \"E18\" in the template.\nIf the variable \"mRAM\" is greater than 7, copy the next Part-Serialnumber in column \"G\" to cell \"E19\" in the template.\nIn the source file, in row of \"All / Components / GPU\" copy the Part-Serialnumber in column \"G\" to cell \"E20\" in the template.\nIf the variable \"mGPU\" is greater than 1, copy the next Part-Serialnumber in column \"G\" to cell \"E21\" in the template.\nIf the variable \"mGPU\" is greater than 2, copy the next Part-Serialnumber in column \"G\" to cell \"E22\" in the template.\nIf the variable \"mGPU\" is greater than 3, copy the next Part-Serialnumber in column \"G\" to cell \"E23\" in the template.\nIn the source file, in row of \"All / Components / SSD\" copy the Part-Serialnumber in column \"G\" to cell \"E24\" in the template.\nIf the variable \"mSSD\" is greater than 1, copy the next Part-Serialnumber in column \"G\" to cell \"E25\" in the template.\nIf the variable \"mSSD\" is greater than 2, copy the next Part-Serialnumber in column \"G\" to cell \"E26\" in the template.\nIf the variable \"mSSD\" is greater than 3, copy the next Part-Serialnumber in column \"G\" to cell \"E27\" in the template.\nIn the source file, in row of \"All / Components / Network\" copy the Part-Serialnumber in column \"G\" to cell \"E28\" in the template.\nIf the variable \"mNIC\" is greater than 1, copy the next Part-Serialnumber in column \"G\" to cell \"E29\" in the template.\nIn the source file, in row of \"All / Components / RAID\" copy the Part-Serialnumber in column \"G\" to cell \"E30\" in the template.\n\n# look for Machine-Serialnumber\nIn the source file, copy cell \"B2\" to a string-variable called \"FA\".\nremove the \"FA-\" from inside the variable.\nIn the source file, copy cell \"C2\" to a string-variable called \"MODEL\".\nremove the \"AIME-\" from inside the variable. \nnow take the \"MODEL\" variable and append it with the the \"FA\" variable.\nIt should look something like this: \"A4004-2604N3\".\nand paste them into cell \"B1:C2\" in the template.\nSave the template as a new file, naming it after cell \"B1:C2\" from the template file.","tokensIn":3478369,"tokensOut":34372,"cacheWrites":0,"cacheReads":0,"totalCost":0,"size":1250519,"workspace":"/home/jeffry/Projects/Laufzettel","mode":"code","apiConfigName":"default"}