


技术领域technical field
本发明涉及线上Excel合并领域,尤其涉及一种基于java实现Excel线上合并及导出的方法。The invention relates to the field of online Excel merging, in particular to a method for realizing online merging and exporting of Excel based on java.
背景技术Background technique
用户线下收集excel表格并对数据进行汇总的工作比较繁琐,费时费力,增加人力成本,并且难免会出现统计错误。It is cumbersome, time-consuming, labor-intensive, and labor-intensive for users to collect excel tables offline and summarize the data, and there will inevitably be statistical errors.
因此,结合上述存在的技术问题,有必要提供一种新的技术方案。Therefore, combined with the above-mentioned technical problems, it is necessary to provide a new technical solution.
发明内容SUMMARY OF THE INVENTION
为解决现有技术中存在的技术问题,本发明提出线上自动合并Excel文件并导出的技术,提供了一种基于java实现Excel线上合并及导出的方法,具体技术方案如下所述,包括如下步骤:In order to solve the technical problems existing in the prior art, the present invention proposes a technology for automatically merging and exporting Excel files online, and provides a method for realizing Excel online merging and exporting based on java. The specific technical solutions are as follows, including the following: step:
S1:用户将Excel文件上传到系统;S1: The user uploads the Excel file to the system;
S2:系统存储所述Excel文件,并对所述Excel文件做版本记录,将版本记录添加于系统的文件列表中;S2: the system stores the Excel file, and makes a version record to the Excel file, and adds the version record to the file list of the system;
S3:用户在系统的文件列表中选择若干所述Excel文件,并点击导出按钮,用户的合并导出请求发送给系统;S3: The user selects several of the Excel files in the file list of the system, and clicks the export button, and the user's combined export request is sent to the system;
S4:系统接收到用户的合并导出请求后,系统调取用户选择的若干Excel文件,系统将若干Excel文件中序号最靠前的Excel文件作为父文件,并将除作为父文件之外的其他Excel文件均作为子文件;S4: After the system receives the merged export request from the user, the system retrieves several Excel files selected by the user, and the system takes the Excel file with the highest serial number among the several Excel files as the parent file, and uses other Excel files other than the parent file as the parent file. The files are treated as sub-files;
S5:若干子文件分别与父文件进行比较,子文件中的每一行数据均与父文件中所有行数据中的每一行进行比较是否相同,若不相同,则将子文件中的不相同行数据追加在父文件数据表下方,获得合并覆盖后的父文件;S5: Several sub-files are compared with the parent file respectively, and each row of data in the sub-file is compared with each row of all the row data in the parent file to see if they are the same. Append it below the parent file data table to obtain the merged and overwritten parent file;
S6:系统将合并覆盖后的父文件作为导出文件导出给用户。S6: The system exports the merged and overwritten parent file to the user as an export file.
进一步的,步骤S5中,若相同,则子文件中的相同行数据覆盖到父文件的相同行数据中,获得合并覆盖后的父文件。Further, in step S5, if they are the same, the same line data in the child file is overwritten with the same line data in the parent file, and the merged and overwritten parent file is obtained.
进一步的,合并覆盖后的父文件只存储在导出文件中,不存储在父文件对应的系统中的Excel文件中。Further, the merged and overwritten parent file is only stored in the export file, and is not stored in the Excel file in the system corresponding to the parent file.
进一步的,步骤S2中,所述版本记录包括序号、填报单位、填报时间、最近修改时间、填报人姓名、填报人手机号和填报状态。Further, in step S2, the version record includes the serial number, the reporting unit, the reporting time, the last modification time, the reporting person's name, the reporting person's mobile phone number, and the reporting status.
进一步的,所述序号依据所述Excel文件的文件名称在字典中的先后顺序依次排序;Further, the sequence number is sorted according to the order of the file name of the Excel file in the dictionary;
所述填报状态包括待提交、已提交、待审核和已审核。The reporting status includes pending submission, submitted, pending review, and reviewed.
进一步的,步骤S3中,用户点击全选按钮,选择全部Excel文件。Further, in step S3, the user clicks the select all button to select all Excel files.
进一步的,步骤S5中,所述子文件依据序号的前后顺序依次与父文件进行比较。Further, in step S5, the child files are compared with the parent file in sequence according to the sequence of the serial numbers.
进一步的,步骤S6中,导出文件以Excel格式导出。Further, in step S6, the export file is exported in Excel format.
进一步的,在文件列表中点击编辑报表按钮进行修改系统中的Excel文件;Further, click the Edit Report button in the file list to modify the Excel file in the system;
在文件列表中点击查看报表按钮进行查看系统中的Excel文件,并可同时选择多个Excel文件进行查看。Click the View Report button in the file list to view the Excel files in the system, and you can select multiple Excel files to view at the same time.
本发明的基于java实现Excel线上合并及导出的方法,具有如下有益效果:The method for realizing Excel online merging and exporting based on java of the present invention has the following beneficial effects:
(1)本发明的基于java实现Excel线上合并及导出的方法,其提供了用户收集子部门填写的excel,然后线上合并excel的功能,用户可以一键操作完成合并和导出查看的工作,简单快捷,省时省力,节省人力成本;(1) The method for realizing Excel online merging and exporting based on java of the present invention provides the user to collect the excel filled in by the sub-department, and then merge the excel function online, the user can complete the work of merging and exporting and viewing by one-key operation, Simple and fast, saving time and effort, saving labor costs;
(2)本发明的基于java实现Excel线上合并及导出的方法,其自动完成合并和导出工作,准确率高,避免出现人为统计错误。(2) The method for realizing Excel online merging and exporting based on java of the present invention automatically completes the merging and exporting work, has a high accuracy rate, and avoids human statistical errors.
本发明的附加方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本发明的实践了解到。Additional aspects and advantages of the present invention will be set forth, in part, from the following description, and in part will be apparent from the following description, or may be learned by practice of the invention.
附图说明Description of drawings
为了更清楚地说明本发明的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它附图。In order to illustrate the technical solutions of the present invention more clearly, the following briefly introduces the accompanying drawings required in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. , for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.
图1为本发明所述的基于java实现Excel线上合并及导出的方法的流程图;Fig. 1 is the flow chart of the method for realizing Excel online merging and exporting based on java according to the present invention;
图2为本发明实施例提供的文件列表示意图;2 is a schematic diagram of a file list provided by an embodiment of the present invention;
图3为本发明实施例提供的合并覆盖后的导出文件效果图。FIG. 3 is an effect diagram of an export file after merging and overwriting provided by an embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
实施例Example
请参阅图1至图3,图1为本发明所述的基于java实现Excel线上合并及导出的方法的流程图,图2为本发明实施例提供的文件列表示意图,图3为本发明实施例提供的合并覆盖后的导出文件效果图。如图1至图3所示,本发明涉及一种基于java实现Excel线上合并及导出的方法,其包括如下步骤:Please refer to FIGS. 1 to 3. FIG. 1 is a flowchart of the method for implementing Excel online merging and exporting based on java according to the present invention, FIG. 2 is a schematic diagram of a file list provided by an embodiment of the present invention, and FIG. 3 is an implementation of the present invention. The example provides the rendering of the exported file after merging and overlaying. As shown in FIG. 1 to FIG. 3 , the present invention relates to a method for realizing Excel online merging and exporting based on java, which includes the following steps:
S1:用户将Excel文件上传到系统;S1: The user uploads the Excel file to the system;
S2:系统存储所述Excel文件,并对所述Excel文件做版本记录,将版本记录添加于系统的文件列表中;示例中,所述版本记录包括序号、填报单位、填报时间、最近修改时间、填报人姓名、填报人手机号和填报状态,所述序号依据所述Excel文件的文件名称在字典中的先后顺序依次排序,所述填报状态包括待提交、已提交、待审核和已审核;S2: the system stores the Excel file, makes a version record for the Excel file, and adds the version record to the file list of the system; in an example, the version record includes serial number, reporting unit, reporting time, last modification time, The name of the person filling in the report, the mobile phone number of the person filling in the report and the filling state, the serial number is sorted according to the order of the file name of the Excel file in the dictionary, and the filling state includes to be submitted, submitted, to be reviewed and reviewed;
S3:用户在系统的文件列表中选择若干所述Excel文件,并点击导出按钮,用户的合并导出请求发送给系统;在其他实施例中,用户点击全选按钮,选择全部Excel文件;S3: the user selects several described Excel files in the file list of the system, and clicks the export button, and the user's combined export request is sent to the system; in other embodiments, the user clicks the select all button to select all Excel files;
S4:系统接收到用户的合并导出请求后,系统调取用户选择的若干Excel文件,系统将若干Excel文件中序号最靠前的Excel文件作为父文件,并将除作为父文件之外的其他Excel文件均作为子文件;S4: After the system receives the merged export request from the user, the system retrieves several Excel files selected by the user, and the system takes the Excel file with the highest serial number among the several Excel files as the parent file, and uses other Excel files other than the parent file as the parent file. The files are treated as sub-files;
S5:若干子文件分别与父文件进行比较,子文件中的每一行数据均与父文件中所有行数据中的每一行进行比较是否相同,若不相同,则将子文件中的不相同行数据追加在父文件数据表下方,获得合并覆盖后的父文件;S5: Several sub-files are compared with the parent file respectively, and each row of data in the sub-file is compared with each row of all the row data in the parent file to see if they are the same. Append it below the parent file data table to obtain the merged and overwritten parent file;
进一步的,若相同,则子文件中的相同行数据覆盖到父文件的相同行数据中,获得合并覆盖后的父文件;Further, if they are the same, the same line data in the child file is overwritten with the same line data in the parent file, and the merged and overwritten parent file is obtained;
示例中,所述子文件依据序号的前后顺序依次与父文件进行比较;In the example, the child file is compared with the parent file in sequence according to the sequence number;
S6:系统将合并覆盖后的父文件作为导出文件导出给用户。S6: The system exports the merged and overwritten parent file to the user as an export file.
进一步的,合并覆盖后的父文件只存储在导出文件中,不存储在父文件对应的系统中的Excel文件中;示例中,导出文件以Excel格式导出,如图3所示的合并覆盖后的导出文件效果图。Further, the merged and overwritten parent file is only stored in the export file, not in the Excel file in the system corresponding to the parent file; in the example, the export file is exported in Excel format, as shown in Figure 3. Export file renderings.
在一些实施例中,如图2所示,在文件列表中点击编辑报表按钮进行修改系统中的Excel文件;在文件列表中点击查看报表按钮进行查看系统中的Excel文件,并可同时选择多个Excel文件进行查看。In some embodiments, as shown in FIG. 2 , click the Edit Report button in the file list to modify the Excel file in the system; click the View Report button in the file list to view the Excel file in the system, and multiple selections can be made at the same time. Excel file to view.
针对上述实施例中上传Excel文件的部分实现代码,示例如下:For part of the implementation code for uploading an Excel file in the above embodiment, the example is as follows:
针对上述实施例中若干Excel文件进行合并覆盖的部分实现代码,示例如下:For the partial implementation code of combining and covering several Excel files in the above-mentioned embodiment, the example is as follows:
本发明的的有益效果是:The beneficial effects of the present invention are:
(1)本发明的基于java实现Excel线上合并及导出的方法,其提供了用户收集子部门填写的excel,然后线上合并excel的功能,用户可以一键操作完成合并和导出查看的工作,简单快捷,省时省力,节省人力成本;(1) The method for realizing Excel online merging and exporting based on java of the present invention provides the user to collect the excel filled in by the sub-department, and then merge the excel function online, the user can complete the work of merging and exporting and viewing by one-key operation, Simple and fast, saving time and effort, saving labor costs;
(2)本发明的基于java实现Excel线上合并及导出的方法,其自动完成合并和导出工作,准确率高,避免出现人为统计错误。(2) The method for realizing Excel online merging and exporting based on java of the present invention automatically completes the merging and exporting work, has a high accuracy rate, and avoids human statistical errors.
尽管上面已经示出和描述了本发明的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本发明的限制,本领域的普通技术人员在本发明的范围内可以对上述实施例进行变化、修改和变型。Although the embodiments of the present invention have been shown and described above, it should be understood that the above-mentioned embodiments are exemplary and should not be construed as limiting the present invention. Embodiments are subject to variations, modifications and variations.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202011267113.XACN114492338A (en) | 2020-11-13 | 2020-11-13 | Method for realizing on-line combination and export of Excel based on java |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202011267113.XACN114492338A (en) | 2020-11-13 | 2020-11-13 | Method for realizing on-line combination and export of Excel based on java |
| Publication Number | Publication Date |
|---|---|
| CN114492338Atrue CN114492338A (en) | 2022-05-13 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202011267113.XAWithdrawnCN114492338A (en) | 2020-11-13 | 2020-11-13 | Method for realizing on-line combination and export of Excel based on java |
| Country | Link |
|---|---|
| CN (1) | CN114492338A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104021449A (en)* | 2014-06-19 | 2014-09-03 | 北京工商大学 | Conglomerate report file merging method and device based on open platform system |
| CN105320681A (en)* | 2014-07-16 | 2016-02-10 | 中兴通讯股份有限公司 | Database content combination method and device |
| CN107248065A (en)* | 2017-06-08 | 2017-10-13 | 中国建设银行股份有限公司 | Line reports table management method, system, device and storage medium |
| CN111104390A (en)* | 2019-11-08 | 2020-05-05 | 珠海金山网络游戏科技有限公司 | Method and system for merging and checking multiple CSV files |
| CN111897778A (en)* | 2020-07-13 | 2020-11-06 | 苏宁金融科技(南京)有限公司 | Computer file merging method, device and system |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104021449A (en)* | 2014-06-19 | 2014-09-03 | 北京工商大学 | Conglomerate report file merging method and device based on open platform system |
| CN105320681A (en)* | 2014-07-16 | 2016-02-10 | 中兴通讯股份有限公司 | Database content combination method and device |
| CN107248065A (en)* | 2017-06-08 | 2017-10-13 | 中国建设银行股份有限公司 | Line reports table management method, system, device and storage medium |
| CN111104390A (en)* | 2019-11-08 | 2020-05-05 | 珠海金山网络游戏科技有限公司 | Method and system for merging and checking multiple CSV files |
| CN111897778A (en)* | 2020-07-13 | 2020-11-06 | 苏宁金融科技(南京)有限公司 | Computer file merging method, device and system |
| Title |
|---|
| JAVA GUY: "Comparing two csv files in Java", pages 1, Retrieved from the Internet <URL:https://stackoverflow.com/questions/10864654/comparing-two-csv-files-in-java>* |
| Publication | Publication Date | Title |
|---|---|---|
| US11593029B1 (en) | Identifying a parent event associated with child error states | |
| US20170192698A1 (en) | Determining byte-hours usage of a vault or by users | |
| US20170123911A1 (en) | Coordinating node modification of an index structure via delegates | |
| US20180018210A1 (en) | Unified logs and device statistics | |
| US20170212925A1 (en) | Utilizing a hierarchical index in a dispersed storage network | |
| US20230112771A1 (en) | Aggregating Audit Records in a Storage Network | |
| CN106469215B (en) | Data import method and system based on web page | |
| CN115113819B (en) | Data storage method, single-node server and device | |
| US20190310782A1 (en) | Handling data slice revisions in a dispersed storage network | |
| CN113256473A (en) | Three-dimensional model format conversion method and device, electronic equipment and system | |
| US11715496B2 (en) | Systems and methods for processing video data | |
| CN112579007B (en) | Method and device for acquiring storage full link and electronic equipment | |
| US12086079B2 (en) | Generating messages with priorities in a storage network | |
| CN110347992B (en) | Data analysis method and system based on electronic report | |
| CN114492338A (en) | Method for realizing on-line combination and export of Excel based on java | |
| CN114490169A (en) | A data page CRC check system | |
| US20050027620A1 (en) | Method, system, and computer-readable medium for updating inventory data in an inventory management system | |
| US10241865B2 (en) | Handling storage unit failure in a dispersed storage network | |
| CN114706746B (en) | Method and device for generating test file and storage medium | |
| CN116756129A (en) | Data complement method and device, storage medium and electronic equipment | |
| CN108090095B (en) | Method and device for reconstructing database in batches | |
| US8311987B2 (en) | Data staging system and method | |
| CN115292277A (en) | Data migration consistency verification method, device, system, equipment and storage medium | |
| US20190138394A1 (en) | Prioritized rebuilds using dispersed indices | |
| CN114860608A (en) | Scene construction based system automation testing method, device, equipment and medium |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| WW01 | Invention patent application withdrawn after publication | ||
| WW01 | Invention patent application withdrawn after publication | Application publication date:20220513 |