Movatterモバイル変換


[0]ホーム

URL:


CN114492338A - Method for realizing on-line combination and export of Excel based on java - Google Patents

Method for realizing on-line combination and export of Excel based on java
Download PDF

Info

Publication number
CN114492338A
CN114492338ACN202011267113.XACN202011267113ACN114492338ACN 114492338 ACN114492338 ACN 114492338ACN 202011267113 ACN202011267113 ACN 202011267113ACN 114492338 ACN114492338 ACN 114492338A
Authority
CN
China
Prior art keywords
excel
file
files
merging
exporting
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN202011267113.XA
Other languages
Chinese (zh)
Inventor
谈辉
缪伟
朱玮
周峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yozosoft Co ltd
Original Assignee
Yozosoft Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yozosoft Co ltdfiledCriticalYozosoft Co ltd
Priority to CN202011267113.XApriorityCriticalpatent/CN114492338A/en
Publication of CN114492338ApublicationCriticalpatent/CN114492338A/en
Withdrawnlegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

The invention discloses a method for realizing on-line merging and exporting of Excel based on java, which comprises the following steps: uploading an Excel file to a system by a user; the system stores the Excel file, makes a version record on the Excel file and adds the version record into a file list of the system; selecting a plurality of Excel files in a file list by a user, and clicking, merging and exporting the Excel files; the system calls a plurality of Excel files, the Excel file with the most front sequence number in the Excel files is used as a parent file, and other Excel files are all used as child files; comparing the plurality of child files with the parent file respectively, comparing whether each row of data of the child files is the same as each row of data of all rows in the parent file respectively, and if not, adding different rows of data in the child files below a data table of the parent file; the system exports the merged parent file to the user. The invention has the advantages that the user completes the merging and exporting checking work by one key, the operation is simple and quick, the labor cost is saved, the accuracy is high, and the occurrence of artificial statistics errors is avoided.

Description

Translated fromChinese
基于java实现Excel线上合并及导出的方法The method of realizing Excel online merging and exporting based on java

技术领域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:

Figure BDA0002776418530000041
Figure BDA0002776418530000041

针对上述实施例中若干Excel文件进行合并覆盖的部分实现代码,示例如下:For the partial implementation code of combining and covering several Excel files in the above-mentioned embodiment, the example is as follows:

Figure BDA0002776418530000051
Figure BDA0002776418530000051

本发明的的有益效果是: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.

Claims (9)

1. A method for realizing on-line merging and exporting of Excel based on java is characterized by comprising the following steps:
s1: uploading the Excel file to the system by the user;
s2: the system stores the Excel file, makes a version record on the Excel file and adds the version record into a file list of the system;
s3: selecting a plurality of Excel files in a file list of the system by a user, clicking an export button, and sending a merged export request of the user to the system;
s4: after the system receives a merging export request of a user, the system calls a plurality of Excel files selected by the user, the system takes the Excel file with the most front serial number in the Excel files as a parent file, and takes other Excel files except the Excel file as child files;
s5: comparing the plurality of child files with the parent file respectively, comparing whether each row of data in the child files is the same as each row of data in all rows of data in the parent file, if not, adding different rows of data in the child files below a data table of the parent file to obtain the parent file after merging and covering;
s6: and exporting the merged and covered parent file to a user as an export file by the system.
2. The method for achieving Excel online merging and exporting according to claim 1 and based on java, wherein in step S5, if they are the same, the same row of data in the child file is overlaid to the same row of data in the parent file, so as to obtain the merged overlaid parent file.
3. The method for achieving Excel online merging and exporting based on java as claimed in claim 2, wherein the parent file after merging and overwriting is only stored in the export file and not stored in the Excel file in the system corresponding to the parent file.
4. The method for achieving Excel on-line merging and exporting based on java as claimed in claim 1, wherein in step S2, said version record comprises serial number, filling unit, filling time, latest modification time, name of filler, mobile phone number of filler and filling status.
5. The method for achieving on-line merging and exporting of Excel based on java according to claim 4, wherein the sequence numbers are sequentially ordered according to the sequence of the file names of the Excel files in a dictionary;
the filling state comprises to-be-submitted, to-be-audited and audited.
6. The method for achieving Excel online merging and exporting according to the java based on claim 1, wherein in step S3, the user clicks the all-select button to select all Excel files.
7. The method for achieving Excel online merging and exporting according to claim 1, wherein in step S5, the child files are sequentially compared with the parent file according to the sequence number.
8. The method for achieving Excel online merging and exporting according to claim 1, wherein in step S6, the export file is exported in Excel format.
9. The method for achieving Excel online merging and exporting based on java according to claim 1, wherein an edit report button is clicked in a file list to modify an Excel file in a system;
and clicking a report viewing button in the file list to view the Excel files in the system, and simultaneously selecting a plurality of Excel files to view.
CN202011267113.XA2020-11-132020-11-13Method for realizing on-line combination and export of Excel based on javaWithdrawnCN114492338A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202011267113.XACN114492338A (en)2020-11-132020-11-13Method for realizing on-line combination and export of Excel based on java

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202011267113.XACN114492338A (en)2020-11-132020-11-13Method for realizing on-line combination and export of Excel based on java

Publications (1)

Publication NumberPublication Date
CN114492338Atrue CN114492338A (en)2022-05-13

Family

ID=81490167

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202011267113.XAWithdrawnCN114492338A (en)2020-11-132020-11-13Method for realizing on-line combination and export of Excel based on java

Country Status (1)

CountryLink
CN (1)CN114492338A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN104021449A (en)*2014-06-192014-09-03北京工商大学Conglomerate report file merging method and device based on open platform system
CN105320681A (en)*2014-07-162016-02-10中兴通讯股份有限公司Database content combination method and device
CN107248065A (en)*2017-06-082017-10-13中国建设银行股份有限公司Line reports table management method, system, device and storage medium
CN111104390A (en)*2019-11-082020-05-05珠海金山网络游戏科技有限公司Method and system for merging and checking multiple CSV files
CN111897778A (en)*2020-07-132020-11-06苏宁金融科技(南京)有限公司Computer file merging method, device and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN104021449A (en)*2014-06-192014-09-03北京工商大学Conglomerate report file merging method and device based on open platform system
CN105320681A (en)*2014-07-162016-02-10中兴通讯股份有限公司Database content combination method and device
CN107248065A (en)*2017-06-082017-10-13中国建设银行股份有限公司Line reports table management method, system, device and storage medium
CN111104390A (en)*2019-11-082020-05-05珠海金山网络游戏科技有限公司Method and system for merging and checking multiple CSV files
CN111897778A (en)*2020-07-132020-11-06苏宁金融科技(南京)有限公司Computer file merging method, device and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
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>*

Similar Documents

PublicationPublication DateTitle
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

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
WW01Invention patent application withdrawn after publication
WW01Invention patent application withdrawn after publication

Application publication date:20220513


[8]ページ先頭

©2009-2025 Movatter.jp