Excel file table data deletion method and device, equipment and medium
By transferring Excel data to a compressed file and using SAXReader for parsing, the method addresses slow deletion speeds and high memory usage, ensuring faster, more secure, and flexible data deletion with improved data integrity.
Patent Information
- Application Number
- CN202411137345.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2024-12-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Current technologies face slow deletion speeds and high memory usage when deleting large amounts of data from Excel files, and there are concerns about data security and consistency during these operations.
The method involves transferring the data to be deleted to a compressed file, using FileChannel for efficient data transfer, parsing the sheet.xml file with SAXReader to obtain row data, and performing deletions in the compressed file to maintain data integrity and security.
This approach improves deletion speed, reduces memory usage, enhances data processing flexibility and security, and ensures data consistency by avoiding direct operations in the Excel file.
Smart Images

Figure CN119106041A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device, equipment and medium for deleting Excel file table data. Background Art
[0002] Excel data is a powerful spreadsheet software that can be used to store various types of data, such as text, numbers, dates, etc. Data can be classified, sorted, filtered, etc. to facilitate data management and analysis.
[0003] As the demand for data governance continues to grow, the processing of Excel data has become increasingly important. In the service backend code layer, it is often necessary to delete data in Excel, especially when deleting a large amount of specified data. However, current technologies face the problem of extremely slow speed when performing these deletion operations. Summary of the invention
[0004] One or more embodiments of the present specification provide a method, device, equipment and medium for deleting Excel file table data, which are used to solve the technical problems raised by the background technology.
[0005] One or more embodiments of this specification adopt the following technical solutions:
[0006] One or more embodiments of this specification provide a method for deleting Excel file table data, the method comprising:
[0007] Get the table data to be deleted in the specified Excel file, and get the pre-created compressed file;
[0008] Transferring the to-be-deleted table data to the compressed file;
[0009] Determine the sheet page corresponding to the table data to be deleted, and determine the path information of the sheet page in the compressed file;
[0010] Determine the corresponding sheet.xml file in the compressed file through the path information;
[0011] Parse the sheet.xml file to obtain corresponding row data;
[0012] The designated Excel file is traversed based on the row data, and the table data corresponding to the row data is deleted, so as to complete the deletion of the table data to be deleted in the designated Excel file.
[0013] It should be noted that the embodiments of this specification have the following beneficial effects through the above contents:
[0014] Improved the speed of deleting table data in Excel files; by transferring the table data to be deleted into a compressed file and processing it in the compressed file, it is possible to avoid directly deleting a large amount of data in the Excel file, thereby improving the deletion speed.
[0015] Reduced memory usage: When processing large amounts of data, working directly in Excel files may result in high memory usage. By transferring data to a compressed file, you can reduce memory usage and improve system performance.
[0016] Improved data processing flexibility: By parsing the sheet.xml file in the compressed file, the corresponding row data can be obtained, so that data processing and deletion operations can be performed more flexibly.
[0017] Improved data security: Transferring the table data to be deleted to a compressed file can avoid direct operations in the Excel file, thereby improving data security.
[0018] Furthermore, the transferring of the to-be-deleted table data into the compressed file includes:
[0019] The to-be-deleted table data is transferred to the compressed file via FileChannel.
[0020] It should be noted that the embodiments of this specification have the following beneficial effects through the above contents:
[0021] Improve data transmission efficiency: FileChannel is an efficient file I / O channel that can achieve fast data transmission. By using FileChannel to transmit the table data to be deleted, the speed and efficiency of data transmission can be improved.
[0022] Further, the to-be-deleted table data is transferred to the compressed file through FileChannel, including:
[0023] Get the source FileChannel corresponding to the specified Excel file;
[0024] Get the target FileChannel corresponding to the compressed file;
[0025] The to-be-deleted table data is transferred from the source FileChannel to the target FileChannel.
[0026] It should be noted that the embodiments of this specification have the following beneficial effects through the above contents:
[0027] Reduce memory usage: When transferring the table data to be deleted from the source FileChannel to the target FileChannel, it is not necessary to load all the data into the memory. Instead, the data can be transferred directly between the files, thus reducing memory usage.
[0028] Furthermore, the parsing of the sheet.xml file to obtain corresponding row data includes:
[0029] The sheet.xml file is parsed through SAXReader to obtain corresponding row data.
[0030] It should be noted that the embodiments of this specification have the following beneficial effects through the above contents:
[0031] Efficiency: SAXReader is an event-driven parser. When parsing an XML file, it does not need to load the entire file into memory, but reads and processes it line by line, so it has high efficiency.
[0032] Low memory usage: Since SAXReader does not need to load the entire XML file into memory, it has a low memory usage and is suitable for processing large XML files.
[0033] Flexibility: SAXReader provides a rich event processing interface. Users can customize the event processing logic according to their needs, thereby achieving flexible parsing of XML files.
[0034] Scalability: SAXReader is a Java-based XML parser with good scalability and can be used in combination with other Java technologies (such as DOM, StAX, etc.) to meet different needs.
[0035] Furthermore, the sheet.xml file is parsed by SAXReader to obtain corresponding row data, including:
[0036] The sheet.xml file is parsed through the read method of SAXReader to obtain the corresponding row data.
[0037] Furthermore, before traversing the designated Excel file based on the row data to delete the table data to be deleted in the designated Excel file, the method further includes:
[0038] The table data in the specified Excel file is locked, and when the specified Excel file is traversed based on the row data, the table data in the specified Excel file is unlocked.
[0039] It should be noted that the embodiments of this specification have the following beneficial effects through the above contents:
[0040] Data consistency: Locking the table data in the specified Excel file before deleting the table data to be deleted can ensure that other processes or threads cannot modify the table data at the same time during the traversal and deletion operations. This helps maintain data consistency and integrity and avoid data inconsistency problems caused by concurrent operations.
[0041] Concurrency control: Through the locking and unlocking mechanism, you can effectively control the concurrent access to the specified Excel file. Only when the lock is acquired can the traversal and deletion operations be performed, thus avoiding multiple processes or threads operating on the file at the same time and reducing the occurrence of conflicts and errors.
[0042] Data security: Locking can prevent unauthorized access or modification of table data. Only processes or threads with correct permissions or locks can perform operations, which improves data security.
[0043] Furthermore, deleting the table data corresponding to the row data to complete the deletion of the table data to be deleted in the specified Excel file includes:
[0044] Delete the table data corresponding to the row data;
[0045] Get the current sheet.xml file;
[0046] Overwriting the sheet.xml file in the compressed file with the current sheet.xml file;
[0047] The data in the compressed file is transferred to the specified Excel file, so as to complete the deletion of the table data to be deleted in the specified Excel file.
[0048] It should be noted that the embodiments of this specification have the following beneficial effects through the above contents:
[0049] Accuracy of data deletion: By deleting the table data corresponding to the row data, you can ensure that the table data to be deleted in the specified Excel file is accurately deleted. This helps maintain data accuracy and consistency.
[0050] Updateability of file overwriting: Get the current sheet.xml file and overwrite the sheet.xml file in the compressed file to ensure that the data in the compressed file is consistent with the current table data. In this way, when the data in the compressed file is transferred to the specified Excel file, the table data can be updated.
[0051] Data transfer integrity: Transferring data from a compressed file to a specified Excel file ensures that the table data to be deleted is completely deleted in the specified file. This helps maintain the integrity and consistency of the file.
[0052] One or more embodiments of this specification provide a device for deleting Excel file table data, including:
[0053] Get the cell, get the table data to be deleted in the specified Excel file, and get the pre-created compressed file;
[0054] A transmission unit, transmitting the to-be-deleted table data to the compressed file;
[0055] A path information determining unit, for determining a sheet page corresponding to the table data to be deleted, and determining path information of the sheet page in the compressed file;
[0056] A file determining unit, determining a corresponding sheet.xml file in the compressed file according to the path information;
[0057] A parsing unit, parsing the sheet.xml file to obtain corresponding row data;
[0058] The deleting unit traverses the specified Excel file based on the row data, and deletes the table data corresponding to the row data, so as to complete the deletion of the table data to be deleted in the specified Excel file.
[0059] One or more embodiments of this specification provide a device for deleting Excel file table data, including:
[0060] at least one processor; and,
[0061] a memory communicatively connected to the at least one processor; wherein,
[0062] The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
[0063] Get the table data to be deleted in the specified Excel file, and get the pre-created compressed file;
[0064] Transferring the to-be-deleted table data to the compressed file;
[0065] Determine the sheet page corresponding to the table data to be deleted, and determine the path information of the sheet page in the compressed file;
[0066] Determine the corresponding sheet.xml file in the compressed file through the path information;
[0067] Parse the sheet.xml file to obtain corresponding row data;
[0068] The designated Excel file is traversed based on the row data, and the table data corresponding to the row data is deleted, so as to complete the deletion of the table data to be deleted in the designated Excel file.
[0069] One or more embodiments of this specification provide a non-volatile computer storage medium storing computer executable instructions, which can achieve the following when executed by a computer:
[0070] Get the table data to be deleted in the specified Excel file, and get the pre-created compressed file;
[0071] Transferring the to-be-deleted table data to the compressed file;
[0072] Determine the sheet page corresponding to the table data to be deleted, and determine the path information of the sheet page in the compressed file;
[0073] Determine the corresponding sheet.xml file in the compressed file through the path information;
[0074] Parse the sheet.xml file to obtain corresponding row data;
[0075] The designated Excel file is traversed based on the row data, and the table data corresponding to the row data is deleted, so as to complete the deletion of the table data to be deleted in the designated Excel file.
[0076] At least one of the above technical solutions adopted in the embodiments of this specification can achieve the following beneficial effects:
[0077] Improved the speed of deleting table data in Excel files; by transferring the table data to be deleted into a compressed file and processing it in the compressed file, it is possible to avoid directly deleting a large amount of data in the Excel file, thereby improving the deletion speed.
[0078] Reduced memory usage: When processing large amounts of data, working directly in Excel files may result in high memory usage. By transferring data to a compressed file, you can reduce memory usage and improve system performance.
[0079] Improved data processing flexibility: By parsing the sheet.xml file in the compressed file, the corresponding row data can be obtained, so that data processing and deletion operations can be performed more flexibly.
[0080] Improved data security: Transferring the table data to be deleted to a compressed file can avoid direct operations in the Excel file, thereby improving data security. BRIEF DESCRIPTION OF THE DRAWINGS
[0081] In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art description. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. In the drawings:
[0082] Figure 1 A flowchart of a method for deleting Excel file table data provided in one or more embodiments of this specification;
[0083] Figure 2 A schematic diagram of the structure of a device for deleting Excel file table data provided by one or more embodiments of this specification;
[0084] Figure 3 A schematic diagram of the structure of a device for deleting Excel file table data provided in one or more embodiments of this specification. DETAILED DESCRIPTION
[0085] The embodiments of this specification provide a method, device, equipment and medium for deleting Excel file table data.
[0086] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0087] Figure 1 This is a flowchart of a method for deleting table data in an Excel file provided in one or more embodiments of this specification, and the process can be executed by a table data deletion system. Certain input parameters or intermediate results in the process allow manual intervention and adjustment to help improve accuracy.
[0088] The method steps of the embodiment of this specification are as follows:
[0089] S102, obtaining table data to be deleted in a specified Excel file, and obtaining a pre-created compressed file.
[0090] In the examples of this specification, the above content can be implemented by the following specific implementation scheme:
[0091] Open the specified Excel file: Use the appropriate method or tool to open the specified Excel file.
[0092] Determine the scope of the table data to be deleted: Determine the scope of the table data to be deleted based on specific needs, which can be the entire worksheet, specific rows or columns, etc.
[0093] Extract the table data to be deleted: Use corresponding methods or tools to extract the table data to be deleted from the Excel file.
[0094] Create compressed file: Use a compression tool or library to create a new compressed file.
[0095] S104: Transfer the table data to be deleted to the compressed file.
[0096] In the examples of this specification, the above content can be implemented by the following specific implementation scheme:
[0097] Get the output stream of the compressed file: Get the output stream of the compressed file through the compression tool or library so that data can be written to the compressed file.
[0098] Create FileChannel: Use appropriate methods or tools to create a FileChannel object to transfer the table data to be deleted to the compressed file.
[0099] It should be noted that the embodiments of this specification have the following beneficial effects through the above contents:
[0100] Improve data transmission efficiency: FileChannel is an efficient file I / O channel that can achieve fast data transmission. By using FileChannel to transmit the table data to be deleted, the speed and efficiency of data transmission can be improved.
[0101] Further, the table data to be deleted is transferred to the compressed file through FileChannel, and a source FileChannel corresponding to the specified Excel file can be obtained; a target FileChannel corresponding to the compressed file can be obtained; and the table data to be deleted is transferred from the source FileChannel to the target FileChannel.
[0102] It should be noted that the embodiments of this specification have the following beneficial effects through the above contents:
[0103] Reduce memory usage: When transferring the table data to be deleted from the source FileChannel to the target FileChannel, it is not necessary to load all the data into the memory. Instead, the data can be transferred directly between the files, thus reducing memory usage.
[0104] S106, determining the sheet page corresponding to the table data to be deleted, and determining the path information of the sheet page in the compressed file.
[0105] In the examples of this specification, the above content can be implemented by the following specific implementation scheme:
[0106] Determine the sheet page where the table data to be deleted is located: Determine the sheet page where the table data to be deleted is located based on specific needs.
[0107] Get the path information of the compressed file: Determine the storage path of the pre-created compressed file.
[0108] Determine the path information of the sheet page in the compressed file: Determine the path information of the sheet page in the compressed file according to the structure and rules of the compressed file.
[0109] S108, determining a corresponding sheet.xml file in the compressed file according to the path information.
[0110] In the examples of this specification, the above content can be implemented by the following specific implementation scheme:
[0111] When searching for a sheet.xml file based on path information, you can use the provided path information to search for the corresponding sheet.xml file in the directory structure of the compressed file.
[0112] S110, parsing the sheet.xml file to obtain corresponding row data.
[0113] In the embodiment of this specification, the sheet.xml file can be parsed by SAXReader to obtain corresponding row data.
[0114] It should be noted that the embodiments of this specification have the following beneficial effects through the above contents:
[0115] Efficiency: SAXReader is an event-driven parser. When parsing an XML file, it does not need to load the entire file into memory, but reads and processes it line by line, so it has high efficiency.
[0116] Low memory usage: Since SAXReader does not need to load the entire XML file into memory, it has a low memory usage and is suitable for processing large XML files.
[0117] Flexibility: SAXReader provides a rich event processing interface. Users can customize the event processing logic according to their needs, thereby achieving flexible parsing of XML files.
[0118] Scalability: SAXReader is a Java-based XML parser with good scalability and can be used in combination with other Java technologies (such as DOM, StAX, etc.) to meet different needs.
[0119] Furthermore, when the sheet.xml file is parsed by SAXReader to obtain the corresponding row data, the sheet.xml file can be parsed by the read method of SAXReader to obtain the corresponding row data.
[0120] It should be noted that the above content can be implemented through the following specific implementation plans:
[0121] Create SAXReader object: Create a SAXReader object using the SAXReader class.
[0122] Call the read method: Use the read method of the created SAXReader object to parse the sheet.xml file.
[0123] Processing parsing results: During the parsing process, you can get row data by implementing corresponding callback methods. These callback methods will be called when an XML element is encountered, and you can process the row data in these methods.
[0124] Extract row data: Extract corresponding row data in the callback method according to specific needs.
[0125] S112: traverse the designated Excel file based on the row data, and delete the table data corresponding to the row data, so as to complete the deletion of the table data to be deleted in the designated Excel file.
[0126] Furthermore, the designated Excel file is traversed based on the row data so that before deleting the table data to be deleted in the designated Excel file, the table data in the designated Excel file can be locked, and when traversing the designated Excel file based on the row data is performed, the table data in the designated Excel file can be unlocked.
[0127] It should be noted that the embodiments of this specification have the following beneficial effects through the above contents:
[0128] Data consistency: Locking the table data in the specified Excel file before deleting the table data to be deleted can ensure that other processes or threads cannot modify the table data at the same time during the traversal and deletion operations. This helps maintain data consistency and integrity and avoid data inconsistency problems caused by concurrent operations.
[0129] Concurrency control: Through the locking and unlocking mechanism, you can effectively control the concurrent access to the specified Excel file. Only when the lock is acquired can the traversal and deletion operations be performed, thus avoiding multiple processes or threads operating on the file at the same time and reducing the occurrence of conflicts and errors.
[0130] Data security: Locking can prevent unauthorized access or modification of table data. Only processes or threads with correct permissions or locks can perform operations, which improves data security.
[0131] Furthermore, when deleting the table data corresponding to the row data to complete the deletion of the table data to be deleted in the specified Excel file, the table data corresponding to the row data can be deleted; obtaining the current sheet.xml file; overwriting the sheet.xml file in the compressed file with the current sheet.xml file; and transferring the data in the compressed file to the specified Excel file to complete the deletion of the table data to be deleted in the specified Excel file.
[0132] It should be noted that the above content can be implemented through the following specific implementation plans:
[0133] Determine the row data to be deleted: Determine the row data to be deleted based on specific conditions or rules.
[0134] Get the current sheet.xml file: Get the current sheet.xml file from the specified location or data source.
[0135] Overwrite the sheet.xml file in the compressed file: Overwrite the corresponding sheet.xml file in the compressed file with the current sheet.xml file obtained.
[0136] Transfer the data in the compressed file to the specified Excel file: Use appropriate methods or tools to transfer the data in the compressed file to the specified Excel file.
[0137] Complete the deletion of the table data to be deleted: In the specified Excel file, complete the deletion of the table data to be deleted based on the transferred data.
[0138] It should be noted that the embodiments of this specification have the following beneficial effects through the above contents:
[0139] Accuracy of data deletion: By deleting the table data corresponding to the row data, you can ensure that the table data to be deleted in the specified Excel file is accurately deleted. This helps maintain data accuracy and consistency.
[0140] Updateability of file overwriting: Get the current sheet.xml file and overwrite the sheet.xml file in the compressed file to ensure that the data in the compressed file is consistent with the current table data. In this way, when the data in the compressed file is transferred to the specified Excel file, the table data can be updated.
[0141] Data transfer integrity: Transferring data from a compressed file to a specified Excel file ensures that the table data to be deleted is completely deleted in the specified file. This helps maintain the integrity and consistency of the file.
[0142] It should be noted that the embodiments of this specification have the following beneficial effects through the above contents:
[0143] Improved the speed of deleting table data in Excel files; by transferring the table data to be deleted into a compressed file and processing it in the compressed file, it is possible to avoid directly deleting a large amount of data in the Excel file, thereby improving the deletion speed.
[0144] Reduced memory usage: When processing large amounts of data, working directly in Excel files may result in high memory usage. By transferring data to a compressed file, you can reduce memory usage and improve system performance.
[0145] Improved data processing flexibility: By parsing the sheet.xml file in the compressed file, the corresponding row data can be obtained, so that data processing and deletion operations can be performed more flexibly.
[0146] Improved data security: Transferring the table data to be deleted to a compressed file can avoid direct operations in the Excel file, thereby improving data security.
[0147] It should be noted that for batch deletion of rows in an Excel table, if there are merged cells in the deleted rows, use sheet.shiftRows(start row, end row, number of rows to move), but this method of deleting rows will result in an error. The embodiment of this specification deletes the table data corresponding to the row data, that is, deletes the entire row of table data to avoid errors. For example, the rows involved in the merged cells are 101-105, and the table data to be deleted is 102 rows. The embodiment of this specification can directly delete the entire row of 102 to avoid errors.
[0148] The technical solutions of the embodiments of this specification are as follows:
[0149] 1. Copy the Excel table where the data needs to be deleted as a compressed package
[0150] a) Create a new file name with the suffix .zip;
[0151] b) Copy the table data to be deleted directly to the compressed package with the suffix zip through FileChannel;
[0152] c) During the following process, the original table is locked and only queries are allowed to prevent data loss during the deletion process.
[0153] 2. Parsing XML files through SAXReader
[0154] a) Determine the sheet page where data needs to be deleted;
[0155] b) Find the path in the zip archive corresponding to the sheet, the relative path of the nth sheet page: / xl / worksheets / sheetn.xml (Note: n is any positive integer);
[0156] c) SAXReader parses the sheet.xml file. The row data corresponds to the root node->sheetData->row. The corresponding value of the r element in the row element is the number of rows.
[0157] 3. Delete data
[0158] a) Clearly define the range of rows of data that you need to delete;
[0159] b) Traverse the row element list, and if the r value is within the range of rows to be deleted, delete the row.
[0160] 4. Save
[0161] a) Save the sheet.xml file;
[0162] b) Overwrite the sheet.xml file in the zip compressed file;
[0163] c) Then directly copy and transfer the data in the zip file to the original table through FileChannel;
[0164] d) Delete the zip compressed file and the data is deleted.
[0165] Figure 2 A schematic diagram of a structure of a device for deleting Excel file table data provided for one or more embodiments of this specification includes: an acquisition unit 202, a transmission unit 204, a path information determination unit 206, a file determination unit 208, a parsing unit 210 and a deletion unit 212.
[0166] The acquisition unit 202 acquires the table data to be deleted in the specified Excel file and acquires the pre-created compressed file;
[0167] A transmission unit 204 transmits the to-be-deleted table data to the compressed file;
[0168] A path information determining unit 206 determines a sheet page corresponding to the table data to be deleted, and determines path information of the sheet page in the compressed file;
[0169] A file determining unit 208, determining a corresponding sheet.xml file in the compressed file according to the path information;
[0170] A parsing unit 210 parses the sheet.xml file to obtain corresponding row data;
[0171] The deleting unit 212 traverses the specified Excel file based on the row data, and deletes the table data corresponding to the row data, so as to complete the deletion of the table data to be deleted in the specified Excel file.
[0172] Figure 3 A schematic diagram of a structure of a device for deleting Excel file table data provided in one or more embodiments of this specification includes:
[0173] at least one processor; and,
[0174] a memory communicatively connected to the at least one processor; wherein,
[0175] The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
[0176] Get the table data to be deleted in the specified Excel file, and get the pre-created compressed file;
[0177] Transferring the to-be-deleted table data to the compressed file;
[0178] Determine the sheet page corresponding to the table data to be deleted, and determine the path information of the sheet page in the compressed file;
[0179] Determine the corresponding sheet.xml file in the compressed file through the path information;
[0180] Parse the sheet.xml file to obtain corresponding row data;
[0181] The designated Excel file is traversed based on the row data, and the table data corresponding to the row data is deleted, so as to complete the deletion of the table data to be deleted in the designated Excel file.
[0182] One or more embodiments of this specification provide a non-volatile computer storage medium storing computer executable instructions, which can achieve the following when executed by a computer:
[0183] Get the table data to be deleted in the specified Excel file, and get the pre-created compressed file;
[0184] Transferring the to-be-deleted table data to the compressed file;
[0185] Determine the sheet page corresponding to the table data to be deleted, and determine the path information of the sheet page in the compressed file;
[0186] Determine the corresponding sheet.xml file in the compressed file through the path information;
[0187] Parse the sheet.xml file to obtain corresponding row data;
[0188] The designated Excel file is traversed based on the row data, and the table data corresponding to the row data is deleted, so as to complete the deletion of the table data to be deleted in the designated Excel file.
[0189] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
Claims
1. A method for deleting Excel file table data, characterized in that: include: Get the table data to be deleted in the specified Excel file, and get the pre-created compressed file; Transferring the to-be-deleted table data to the compressed file; Determine the sheet page corresponding to the table data to be deleted, and determine the path information of the sheet page in the compressed file; Determine the corresponding sheet.xml file in the compressed file through the path information; Parse the sheet.xml file to obtain corresponding row data; The designated Excel file is traversed based on the row data, and the table data corresponding to the row data is deleted, so as to complete the deletion of the table data to be deleted in the designated Excel file.
2. The method according to claim 1, characterized in that The transferring the to-be-deleted table data to the compressed file comprises: The to-be-deleted table data is transferred to the compressed file via FileChannel.
3. The method according to claim 2, characterized in that The method of transferring the table data to be deleted to the compressed file through FileChannel includes: Get the source FileChannel corresponding to the specified Excel file; Get the target FileChannel corresponding to the compressed file; The to-be-deleted table data is transferred from the source FileChannel to the target FileChannel.
4. The method according to claim 1, characterized in that: The parsing of the sheet.xml file to obtain corresponding row data includes: The sheet.xml file is parsed through SAXReader to obtain corresponding row data.
5. The method according to claim 4, characterized in that The sheet.xml file is parsed by SAXReader to obtain corresponding row data, including: The sheet.xml file is parsed through the read method of SAXReader to obtain the corresponding row data.
6. The method according to claim 1, characterized in that The method further includes: traversing the designated Excel file based on the row data to delete the table data to be deleted in the designated Excel file before deleting the table data to be deleted. The table data in the specified Excel file is locked, and when the specified Excel file is traversed based on the row data, the table data in the specified Excel file is unlocked.
7. The method according to claim 1, characterized in that Deleting the table data corresponding to the row data to complete the deletion of the table data to be deleted in the specified Excel file includes: Delete the table data corresponding to the row data; Get the current sheet.xml file; Overwriting the sheet.xml file in the compressed file with the current sheet.xml file; The data in the compressed file is transferred to the specified Excel file, so as to complete the deletion of the table data to be deleted in the specified Excel file.
8. A device for deleting Excel file table data, characterized in that: include: Get the cell, get the table data to be deleted in the specified Excel file, and get the pre-created compressed file; A transmission unit, transmitting the to-be-deleted table data to the compressed file; A path information determining unit, for determining a sheet page corresponding to the table data to be deleted, and determining path information of the sheet page in the compressed file; A file determining unit, determining a corresponding sheet.xml file in the compressed file according to the path information; A parsing unit, parsing the sheet.xml file to obtain corresponding row data; The deleting unit traverses the specified Excel file based on the row data, and deletes the table data corresponding to the row data, so as to complete the deletion of the table data to be deleted in the specified Excel file.
9. A device for deleting Excel file table data, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to: Get the table data to be deleted in the specified Excel file, and get the pre-created compressed file; Transferring the to-be-deleted table data to the compressed file; Determine the sheet page corresponding to the table data to be deleted, and determine the path information of the sheet page in the compressed file; Determine the corresponding sheet.xml file in the compressed file through the path information; Parse the sheet.xml file to obtain corresponding row data; The designated Excel file is traversed based on the row data, and the table data corresponding to the row data is deleted, so as to complete the deletion of the table data to be deleted in the designated Excel file.
10. A non-volatile computer storage medium, characterized in that: Computer executable instructions are stored, and when the computer executable instructions are executed by a computer, the following can be achieved: Get the table data to be deleted in the specified Excel file, and get the pre-created compressed file; Transferring the to-be-deleted table data to the compressed file; Determine the sheet page corresponding to the table data to be deleted, and determine the path information of the sheet page in the compressed file; Determine the corresponding sheet.xml file in the compressed file through the path information; Parse the sheet.xml file to obtain corresponding row data; The designated Excel file is traversed based on the row data, and the table data corresponding to the row data is deleted, so as to complete the deletion of the table data to be deleted in the designated Excel file.
