CN107480112A - A kind of method and device of order row information output - Google Patents
A kind of method and device of order row information output Download PDFInfo
- Publication number
- CN107480112A CN107480112A CN201710685739.4A CN201710685739A CN107480112A CN 107480112 A CN107480112 A CN 107480112A CN 201710685739 A CN201710685739 A CN 201710685739A CN 107480112 A CN107480112 A CN 107480112A
- Authority
- CN
- China
- Prior art keywords
- output
- field
- content
- temporary file
- row
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/103—Formatting, i.e. changing of presentation of documents
- G06F40/106—Display of layout of documents; Previewing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/103—Formatting, i.e. changing of presentation of documents
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The invention discloses a kind of method of order row information output, the output order inputted according to user, determine the text where user's content to be obtained, and the first row field of text is extracted, the field that user wants to obtain is found in the first row field, and the subscript that user thinks the field of acquisition is obtained, the content for wanting to obtain by row output user according to subscript.Content, that is, the corresponding content of each field are exported in a row, therefore the content exported is very clear by row, and resolution is very high.Simultaneously as when exporting content every time, the subscript list of aiming field is all obtained, therefore the content to be exported can be dynamically found according to subscript, when reducing order of the field change, the uncertainty of content is exported, so as to reduce the cost of maintenance.The invention also discloses a kind of device of order row information output, above-mentioned technique effect can be equally realized.
Description
Technical field
The present invention relates to order line field operation, more specifically to the method and dress of a kind of output of order row information
Put.
Background technology
In the research and development of software activity based on Linux platform, for software development and tester, ordered using Linux
It is very frequently thing that order row, which obtains information,.But information exports no unified specification, output in Linux command row
Information in be typically to be separated between field and field by space or Tab, when field is a lot, identify some field
The content of corresponding output row is just very difficult.
The method solved at present is typically to be output to screen again after first being handled before content output using AWK instruments
Curtain.But the characteristics of AWK instruments is with each field of Digital ID, when field is many, it is necessary to by artificially counting number
Method some or certain several fields for just can determine that needs export, it is inconvenient.In addition, the output of Linux command row
Field, which puts in order, to be changed in typesetting evolution, such as original field output order is A B C, in redaction then
With regard to cumbersome when becoming A D B C, then reading field, so as to be safeguarded to the automatic test cases based on Linux command row
Larger uncertainty is introduced, adds the maintenance cost of software test code.
Therefore, how clearly content is simply exported, is that those skilled in the art need to solve the problems, such as.
The content of the invention
It is an object of the invention to provide a kind of method of order row information output, simply to export clearly content.
To achieve the above object, the embodiments of the invention provide following technical scheme:
A kind of method of order row information output, including:
Ordered according to output and determine target text, obtain the aiming field of the target text;
Judge in the aiming field with the presence or absence of the field to be output in the output order;
If so, the subscript list of the field to be output is then obtained using the aiming field;
Text to be output is obtained from the file destination according to the subscript list, by the field to be output with it is described
Text to be output is preserved to temporary file, wherein each field to be output text to be output corresponding with each field to be output is protected
The same row in the temporary file be present;
The each column content of the temporary file is exported according to preset rules.
Wherein, before each column content that the temporary file is exported according to preset rules, in addition to:
Judge whether there are accurate match options in the output order;
If so, then deleting the aiming field in the temporary file, the temporary file is exported according to preset rules
Each column content;
If it is not, then continue executing with it is described the temporary file is exported according to preset rules each column content the step of.
Wherein, when having preset colored output identification, in each column that the temporary file is exported according to preset rules
Before appearance, in addition to:
Handle the content in the temporary file line by line according to pre-set color.
Wherein, before each column content that the temporary file is exported according to preset rules, in addition to:
The Breadth Maximum value of each row content in the temporary file sets the width of each row.
Wherein, the preset rules include:
File content left-justify pattern or file content Right Aligns pattern.
A kind of device of order row information output, including:
Aiming field acquisition module, target text is determined for being ordered according to output, obtains the target of the target text
Field;
First judge module, for judging in the aiming field with the presence or absence of the word to be output in the output order
Section;
Subscript list acquisition module, for the field to be output in it the output in the aiming field be present and order
When, utilize the subscript list of the aiming field acquisition field to be output;
Text acquisition module to be output, for obtaining text to be output from the file destination according to the subscript list
This, the field to be output and the text to be output are preserved to temporary file, wherein each field to be output is with each treating
Text to be output is stored in the same row in the temporary file corresponding to output field;
First output module, for exporting each column content of the temporary file according to preset rules.
Wherein, in addition to:
Second judge module, before each column content that the temporary file is exported according to preset rules, judge
Whether there are accurate match options in the output order;If it is not, then continue to call first output module;
Second output module, for when it is described output order in have accurate match options when, by the temporary file
Aiming field is deleted, and each column content of the temporary file is exported according to preset rules.
Wherein, in addition to:
Color treatments module, for when having preset colored output identification, facing described according to exporting preset rules
When file each column content before, handle the content in the temporary file line by line according to pre-set color.
Wherein, in addition to:
Width setting module, for before each column content that the temporary file is exported according to preset rules, obtaining
The Breadth Maximum value of each row content in the temporary file is taken, the width of each row is set according to the Breadth Maximum value.
Wherein, the preset rules include:
File content left-justify pattern or file content Right Aligns pattern.
By above scheme, a kind of method of order row information output provided in an embodiment of the present invention, according to output
Order determines target text, obtains the aiming field of the target text;Judge in the aiming field with the presence or absence of described defeated
The field to be output gone out in order;If so, the subscript list of the field to be output is then obtained using the aiming field;According to
The subscript list obtains text to be output from the file destination, and the field to be output and the text to be output are protected
Deposit to temporary file, wherein each field to be output text to be output corresponding with each field to be output be stored in it is described temporarily
Same row in file;The each column content of the temporary file is exported according to preset rules.
A kind of method of order row information output provided in an embodiment of the present invention, the output order inputted according to user, really
Determine the text where user's content to be obtained, and the first row field of text is extracted, found in the first row field
User wants the field obtained, and obtains the subscript that user thinks the field of acquisition, wants to obtain by row output user according to subscript
Content.Content, that is, content corresponding to each field are exported in a row, therefore the content exported is very clear by row,
Resolution is very high.Simultaneously as when exporting content every time, the subscript list of aiming field is all obtained, therefore can dynamic root
The content to be exported is found according to subscript, when reducing order of the field change, exports the uncertainty of content, reduce maintenance into
This.The embodiment of the invention also discloses a kind of device of order row information output, above-mentioned technique effect can be equally realized.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are only this
Some embodiments of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can be with
Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 is a kind of method flow diagram of command information output disclosed in the embodiment of the present invention;
Fig. 2 is a kind of method flow diagram of specific command information output disclosed in the embodiment of the present invention;
Fig. 3 is a kind of accurate match pattern design sketch of the method for command information output disclosed in the embodiment of the present invention;
Fig. 4 is a kind of undefined colored output identification of user of the method for command information output disclosed in the embodiment of the present invention
Output content design sketch;
Fig. 5 is the effect that a kind of user of the method for command information output disclosed in the embodiment of the present invention defines Right Aligns
Figure;
Fig. 6 is a kind of apparatus structure schematic diagram of command information output disclosed in the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.It is based on
Embodiment in the present invention, those of ordinary skill in the art are obtained every other under the premise of creative work is not made
Embodiment, belong to the scope of protection of the invention.
The embodiment of the invention discloses a kind of method of order row information output, simply to export clearly content.
Referring to Fig. 1, a kind of method of order row information output provided in an embodiment of the present invention, specifically include:
S101, ordered according to output and determine target text, obtain the aiming field of the target text;
Specifically, output order refers to the order of user's input, by exporting order it is known that needing which text exported
Content corresponding to which of part field.File first according to where output order determines content to be output, that is, target
File;The first row field in file destination is extracted, wherein the first row field is to include the mesh of all fields in file destination
Marking-up section.
S102, judge in the aiming field with the presence or absence of the field to be output in the output order;
Specifically, field corresponding to content to be output, that is, field to be output can be determined in being ordered from output, is sentenced
Whether need output field in disconnected aiming field, i.e. judge whether there is content to be output in all fields in target text
Corresponding field, that is to say, that judge whether there is content to be output in file destination by field.If so, S103 is then performed,
If it is not, then can be with the information of feedback error.
S103, the subscript list of the field to be output is obtained using the aiming field;
Need output field in aiming field, then determine to take the subscript list of field, subscript row out of according to aiming field
Table can be field to be output order in aiming field, such as aiming field is " A:B:C:D:E ", field to be output are " B:
C:A ", then subscript list is " 2:3:1";
S104, text to be output is obtained from the file destination according to the subscript list, by the field to be output
Preserved with the text to be output to temporary file, wherein each field to be output and each field to be output are corresponding to be output
Text is stored in the same row in the temporary file;
Specifically, text to be output corresponding to being obtained using subscript list in file destination, by text to be output and treat
Output field alarm is into temporary file, and wherein field arranges with corresponding text one.For example, field to be output is " B:C:A ",
Text corresponding to wherein B is b1, b2, b3;Text corresponding to C is c1, c2, c3;Text corresponding to A is a1, a2, a3.Then can be with
Temporary file is arrived with following form storages.
S105, each column content of the temporary file is exported according to preset rules.
Specifically, preset rules can be file content left-justify pattern or file content Right Aligns pattern.According to default
Pattern exports the content of temporary file.It should be noted that after output content, temporary file is deleted.
By above scheme, a kind of method of order row information output provided in an embodiment of the present invention, according to user
The output order of input, the text where user's content to be obtained is determined, and the first row field of text is extracted,
The field that user wants to obtain is found in the first row field, and obtains the subscript that user thinks the field of acquisition, according to subscript by row
Output user wants obtained content.Content, that is, content corresponding to each field are exported in a row, therefore export by row
Content it is very clear, resolution is very high.Simultaneously as when exporting content every time, the subscript list of aiming field is all obtained, because
This can dynamically find the content to be exported according to subscript, when reducing order of the field change, export the uncertainty of content,
Reduce the cost of maintenance.
In order that output text supports accurate match pattern, provided based on above-described embodiment embodiment of the present invention a kind of specific
Order row information output method, referring to Fig. 2, the embodiment of the present invention specifically includes:
S201, ordered according to output and determine target text, obtain the aiming field of the target text;
S202, judge in the aiming field with the presence or absence of the field to be output in the output order;
S203, if so, then obtaining the subscript list of the field to be output using the aiming field;
S204, text to be output is obtained from the file destination according to the subscript list, by the field to be output
Preserved with the text to be output to temporary file, wherein each field to be output and each field to be output are corresponding to be output
Text is stored in the same row in the temporary file;
S205, judge whether there are accurate match options in the output order;If so, S206 is then performed, if it is not, then performing
S207;
It should be noted that precisely match options can be-p the options in output order, if having-p in output order
Option, then it is assumed that output order is accurate match pattern, then need not show the aiming field of the first row.
S206, the aiming field in the temporary file is deleted, the every of the temporary file is exported according to preset rules
Row content;
S207, each column content of the temporary file is exported according to preset rules.
For more clearly display output text, a kind of specific order is provided based on above-described embodiment embodiment of the present invention
The method of row information output, is specifically included:
When having preset color output identification, it is described according to preset rules export the temporary file each column content it
Before, in addition to:
Handle the content in the temporary file line by line according to pre-set color.
Specifically, if there is provided need to export by color, then just according to the color of acquiescence to the text in temporary file
This is handled line by line, for example, the first behavior field row, using blueness, all content of text rows below, shiny red is used according to row
(magenta) alternately exported with sky blue (cyan).It should be noted that for more preferable visual effect, when handling line by line,
It can be arranged alternately with different lines color in every a line, same column uses same color.
In order to reasonably set each column width of output content, the embodiment of the present invention provides a kind of specific order line letter
The method of output is ceased, specifically, before each column content that the temporary file is exported according to preset rules, in addition to:
The Breadth Maximum value of each row content in the temporary file sets the width of each row.
Specifically, for example, field to be output is " B:C:Text corresponding to A ", wherein A is a1, a2, a3;Wherein a1 width
The width that the width spent for 6, a2 is 7, a3 is 8, then col width corresponding to A can be set according to a3 width, clear in order to show
It is clear, 1 can be added on the basis of a3 width, that is, col width could be arranged to 9.Similarly B, C row are also similarly set.
The embodiment of the present invention provides a kind of method of specific order row information output, specifically includes:
The embodiment of the present invention using Bash+awk language carry out arthmetic statement, implement can be used Bash+awk or
Python.It should be noted that need before the implementation by space or Tab replace with colon (:), wherein continuous space or
Tab is replaced with a colon, and compromise processing can be realized quickly in Linux platform using tr orders again.
It is assumed that order corresponding to the Linux command row to be extracted output is foo, the order row information that this programme provides exports
Corresponding script is lsgen.It is as follows to perform foo outputs:
veli@idorax:~$ foo
DESTINATION:GATEWAY:GENMASK:FLAGS:METRIC:REF:USE:IFACE
default:10.11.255.254:0.0.0.0:UG:0:0:0:eth0
10.158.0.0:0.0.0.0:255.255.0.0:U:1:0:0:eth0
100.0.0.0:100.1.255.254:255.0.0.0:UG:20:0:0:eth1
Wherein, the 1st behavior field, separator is used as using colon.2-4 behaviors text to be shown, equally using colon as
Decollator.
Now it is required to it is IFACE, FLAGS to extract field.Performed in Linux terminal and format row extraction order, output
It is as follows:
veli@idorax:~$ foo | lsgen-p-o IFACE, FLAGS
eth0:UG
eth0:U
eth1:UG
1st step:The first row of target is extracted, as whole field FD_FULL, wherein the first row includes in file destination
All fields, in upper example, FD_FULL DESTINATION:GATEWAY:GENMASK:FLAGS:METRIC:REF:
USE:IFACE;
2nd step:According to user input list of fields FD_USER to be output (such as:IFACE, FLAGS), in FD_FULL
In inquired about.As user input list of fields in there is any one field to be not present, then report an error and exit;
3rd step:As user input list of fields FD_USER each field in FD_FULL, then export one
Subscript list INDEX_USER.Such as:FD_FULL=" A:B:C:D:E ", FD_USER=" B:C:A ", then INDEX_USER="
2:3:1";
4th step:According to subscript list INDEX_USER by the content in row extraction text to be shown, temporary file is saved in
F_TMP;
5th step:If user specifies-p options (namely support can accurate match pattern), temporary file F_ is deleted
The first row (list of fields) in TMP, then directly prints to standard output by temporary file F_TMP content;
6th step:If user does not specify-p options (namely general display mode), defeated according to user-defined color
Go out mark and temporary file F_TMP is output to screen.It is such as the non-setpoint color output identification of user, then temporary file F_TMP is straight
Connect and be output to screen;Otherwise handle, the first behavior field row, exported using blue (blue) line by line;All the elements row below
According to the alternately output of shiny red (magenta) and sky blue (cyan) (purpose done so is to improve Consumer's Experience);Separately
Outside, in general display mode, the alignment thereof of acquiescence is to left-justify, if user passes through the ALGIN=that sets
Right, then alignment thereof is to align right;
7th step:Delete temporary file F_TMP.
It should be noted that the entitled lsgen of program after the completion of specific implementation, content such as Fig. 3 is exported to figure using lsgen
Shown in 5.Fig. 3 is accurate match pattern design sketch;Fig. 4 is the output content design sketch of the undefined colored output identification of user, is write from memory
It is left-justify to recognize alignment thereof;Fig. 5 is the design sketch that user defines Right Aligns.
A kind of device of order row information output provided by the invention is introduced below, a kind of order being described below
The method that the device of row information output exports with a kind of above-mentioned order row information can be with cross-referenced.
A kind of device of order row information output provided by the invention of reference picture 6 specifically includes:
Aiming field acquisition module 301, target text is determined for being ordered according to output, obtains the mesh of the target text
Marking-up section;
Specifically, output order refers to the order of user's input, by exporting order it is known that needing which text exported
Content corresponding to which of part field.Aiming field acquisition module 301 determines content institute to be output according to output order first
File, that is, file destination;The first row field in file destination is extracted, wherein the first row field is to include target
The aiming field of all fields in file.
First judge module 302, for judging in the aiming field with the presence or absence of to be output in the output order
Field;
Specifically, field corresponding to content to be output, that is, field to be output can be determined in being ordered from output, the
One judge module 302 judges whether need output field in aiming field, i.e. judge in all fields in target text whether
There is field corresponding to content to be output, that is to say, that judge whether there is content to be output in file destination by field.If
It is then to perform S103, if it is not, then can be with the information of feedback error.
Subscript list acquisition module 303, for the word to be output in it the output in the aiming field be present and order
Duan Shi, the subscript list of the field to be output is obtained using the aiming field;
Specifically, output field is needed in aiming field, then subscript list acquisition module 303 determines according to aiming field
Take the subscript list of field out of, subscript list can be field to be output order in aiming field, such as aiming field is " A:
B:C:D:E ", field to be output are " B:C:A ", then subscript list is " 2:3:1";
Text acquisition module 304 to be output, it is to be output for being obtained according to the subscript list from the file destination
Text, the field to be output and the text to be output are preserved to temporary file, wherein each field to be output with it is each
Text to be output is stored in the same row in the temporary file corresponding to field to be output;
Specifically, text acquisition module 304 to be output using subscript list obtained in file destination corresponding to it is to be output
Text, by text to be output and field alarm to be output into temporary file, wherein field arranges with corresponding text one.Example
Such as, field to be output is " B:C:Text corresponding to A ", wherein B is b1, b2, b3;Text corresponding to C is c1, c2, c3;A is corresponding
Text be a1, a2, a3.Then temporary file can be arrived with following form storages.
First output module 305, for exporting each column content of the temporary file according to preset rules.
Specifically, preset rules can be file content left-justify pattern or file content Right Aligns pattern.First output
Module 305 exports the content of temporary file according to preset mode.
By above scheme, a kind of method of order row information output provided in an embodiment of the present invention, according to user
The output order of input, aiming field acquisition module 301 determine the text where user's content to be obtained, and by the of text
A line field extracts, and subscript list acquisition module 303 finds the field that user wants to obtain in the first row field, and obtains
The subscript that the field of acquisition is thought at family is taken, text acquisition module 304 to be output wants what is obtained according to subscript by row output user
Content.Content is exported by row, that is, content corresponding to each field is known in a row, therefore the content exported is very clear
Do not spend very high.Simultaneously as when exporting content every time, the subscript list of aiming field is all obtained, therefore can dynamic basis
Subscript finds the content to be exported, and when reducing order of the field change, exports the uncertainty of content, reduce maintenance into
This.
In order that output text supports accurate match pattern, provided based on above-described embodiment embodiment of the present invention a kind of specific
Order row information output device, based on above-described embodiment, the embodiment of the present invention specifically includes:
Aiming field acquisition module 301, target text is determined for being ordered according to output, obtains the mesh of the target text
Marking-up section;
First judge module 302, for judging in the aiming field with the presence or absence of to be output in the output order
Field;
Subscript list acquisition module 303, for the word to be output in it the output in the aiming field be present and order
Duan Shi, the subscript list of the field to be output is obtained using the aiming field;
Text acquisition module 304 to be output, it is to be output for being obtained according to the subscript list from the file destination
Text, the field to be output and the text to be output are preserved to temporary file, wherein each field to be output with it is each
Text to be output is stored in the same row in the temporary file corresponding to field to be output;
Second judge module 401, before each column content that the temporary file is exported according to preset rules, sentence
Whether there are accurate match options in the disconnected output order;If it is not, then continue to call first output module 305;
It should be noted that precisely match options can be-p the options in output order, if having-p in output order
Option, then it is assumed that output order is accurate match pattern, then need not show the aiming field of the first row.
Second output module 402, for when it is described output order in have accurate match options when, by the temporary file
Aiming field delete, each column content of the temporary file is exported according to preset rules.
First output module 305, for exporting each column content of the temporary file according to preset rules.
For more clearly display output text, a kind of specific order is provided based on above-described embodiment embodiment of the present invention
The device of row information output, specifically, the embodiment of the present invention also includes:
Color treatments module, for when having preset colored output identification, facing described according to exporting preset rules
When file each column content before, handle the content in the temporary file line by line according to pre-set color.
Specifically, if there is provided need to export by color, then color treatments module is just according to the color of acquiescence to facing
When file in text handle line by line, for example, the first behavior field row, using blueness, all content of text rows below, according to
Row is alternately exported using shiny red (magenta) and sky blue (cyan).It should be noted that for more preferable visual effect,
When handling line by line, it can be arranged alternately with different lines color in every a line, same column uses same color.
In order to reasonably set each column width of output content, the embodiment of the present invention provides a kind of specific order line letter
The device of output is ceased, specifically, is also included based on above-described embodiment embodiment of the present invention:
Width setting module, for before each column content that the temporary file is exported according to preset rules, obtaining
The Breadth Maximum value of each row content in the temporary file is taken, the width of each row is set according to the Breadth Maximum value.
Specifically, for example, field to be output is " B:C:Text corresponding to A ", wherein A is a1, a2, a3;Wherein a1 width
The width that the width spent for 6, a2 is 7, a3 is 8, then col width corresponding to A can be set according to a3 width, clear in order to show
It is clear, 1 can be added on the basis of a3 width, that is, col width could be arranged to 9.Similarly B, C row are also similarly set.
Each embodiment is described by the way of progressive in this specification, what each embodiment stressed be and other
The difference of embodiment, between each embodiment identical similar portion mutually referring to.
The foregoing description of the disclosed embodiments, professional and technical personnel in the field are enable to realize or using the present invention.
A variety of modifications to these embodiments will be apparent for those skilled in the art, as defined herein
General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, it is of the invention
The embodiments shown herein is not intended to be limited to, and is to fit to and principles disclosed herein and features of novelty phase one
The most wide scope caused.
Claims (10)
- A kind of 1. method of order row information output, it is characterised in that including:Ordered according to output and determine target text, obtain the aiming field of the target text;Judge in the aiming field with the presence or absence of the field to be output in the output order;If so, the subscript list of the field to be output is then obtained using the aiming field;Text to be output is obtained from the file destination according to the subscript list, by the field to be output with it is described treat it is defeated Go out text to preserve to temporary file, wherein each field to be output text to be output corresponding with each field to be output is stored in Same row in the temporary file;The each column content of the temporary file is exported according to preset rules.
- 2. according to the method for claim 1, it is characterised in that described to export the every of the temporary file according to preset rules Before row content, in addition to:Judge whether there are accurate match options in the output order;If so, then deleting the aiming field in the temporary file, each column of the temporary file is exported according to preset rules Content;If it is not, then continue executing with it is described the temporary file is exported according to preset rules each column content the step of.
- 3. according to the method for claim 1, it is characterised in that when having preset colored output identification, the basis is preset Before rule exports each column content of the temporary file, in addition to:Handle the content in the temporary file line by line according to pre-set color.
- 4. according to the method for claim 1, it is characterised in that described to export the every of the temporary file according to preset rules Before row content, in addition to:The Breadth Maximum value of each row content in the temporary file sets the width of each row.
- 5. method as claimed in any of claims 1 to 4, it is characterised in that the preset rules include:File content left-justify pattern or file content Right Aligns pattern.
- A kind of 6. device of order row information output, it is characterised in that including:Aiming field acquisition module, target text is determined for being ordered according to output, obtains the aiming field of the target text;First judge module, for judging in the aiming field with the presence or absence of the field to be output in the output order;Subscript list acquisition module, for when exist in the aiming field it is described output order in field to be output when, profit The subscript list of the field to be output is obtained with the aiming field;Text acquisition module to be output, will for obtaining text to be output from the file destination according to the subscript list The field to be output is preserved to temporary file with the text to be output, wherein each field to be output and each word to be output Text to be output corresponding to section is stored in the same row in the temporary file;First output module, for exporting each column content of the temporary file according to preset rules.
- 7. device according to claim 6, it is characterised in that also include:Second judge module, before each column content that the temporary file is exported according to preset rules, described in judgement Whether there are accurate match options in output order;If it is not, then continue to call first output module;Second output module, for when it is described output order in have accurate match options when, by the target in the temporary file Field is deleted, and each column content of the temporary file is exported according to preset rules.
- 8. device according to claim 6, it is characterised in that also include:Color treatments module, for when having preset colored output identification, the interim text to be exported according to preset rules described Before each column content of part, the content in the temporary file is handled line by line according to pre-set color.
- 9. device according to claim 6, it is characterised in that also include:Width setting module, for before each column content that the temporary file is exported according to preset rules, obtaining institute The Breadth Maximum value of each row content in temporary file is stated, the width of each row is set according to the Breadth Maximum value.
- 10. the device according to any one in claim 6 to 9, it is characterised in that the preset rules include:File content left-justify pattern or file content Right Aligns pattern.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710685739.4A CN107480112A (en) | 2017-08-11 | 2017-08-11 | A kind of method and device of order row information output |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710685739.4A CN107480112A (en) | 2017-08-11 | 2017-08-11 | A kind of method and device of order row information output |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107480112A true CN107480112A (en) | 2017-12-15 |
Family
ID=60600322
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710685739.4A Pending CN107480112A (en) | 2017-08-11 | 2017-08-11 | A kind of method and device of order row information output |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107480112A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050091586A1 (en) * | 2003-10-24 | 2005-04-28 | Snover Jeffrey P. | Mechanism for providing data driven command line output |
CN103455307A (en) * | 2012-05-29 | 2013-12-18 | 腾讯科技(深圳)有限公司 | Method and device for processing information output by command line |
CN106445480A (en) * | 2015-08-12 | 2017-02-22 | 成都华为技术有限公司 | Command line interface display method and apparatus |
CN106649627A (en) * | 2016-12-06 | 2017-05-10 | 杭州迪普科技股份有限公司 | Log searching method and device |
-
2017
- 2017-08-11 CN CN201710685739.4A patent/CN107480112A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050091586A1 (en) * | 2003-10-24 | 2005-04-28 | Snover Jeffrey P. | Mechanism for providing data driven command line output |
CN103455307A (en) * | 2012-05-29 | 2013-12-18 | 腾讯科技(深圳)有限公司 | Method and device for processing information output by command line |
CN106445480A (en) * | 2015-08-12 | 2017-02-22 | 成都华为技术有限公司 | Command line interface display method and apparatus |
CN106649627A (en) * | 2016-12-06 | 2017-05-10 | 杭州迪普科技股份有限公司 | Log searching method and device |
Non-Patent Citations (1)
Title |
---|
周诚彪: "《FoxPro 2.6for Windows程序设计》", 31 May 1996 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101430758B (en) | Document recognizing apparatus and method | |
CN105718272B (en) | A kind of method and terminal of terminal factory reset | |
CN105117464B (en) | Application pushing method and device and service equipment | |
US8046677B2 (en) | Displaying relationships between tabular data using spatial identifiers | |
CN108961250B (en) | Target object statistical method, device, terminal and storage medium | |
CN106598564A (en) | Method for implementing BIOS capable of self-adapting to different main boards, BIOS, and main board | |
CN107704436A (en) | Sampling of data method, terminal, equipment and computer-readable recording medium | |
CN106033305A (en) | Screen color picking method and device | |
CN106528821A (en) | Method for importing change column data into database | |
CN109410295A (en) | Color setting method, device, equipment and computer readable storage medium | |
CN105809117A (en) | Information prompt method and user terminal | |
US20220121325A1 (en) | User interface customization per application | |
CN104933405B (en) | A kind of data processing method and terminal | |
CN107480112A (en) | A kind of method and device of order row information output | |
CN108805115A (en) | Recognition methods, device, equipment and the storage medium of word in a kind of picture | |
US11392260B2 (en) | Display control device, display control method, and display control program | |
CN105335430B (en) | A kind of customer churn determining method of path and device based on map scene | |
CN107194944A (en) | Forest fire image dividing method and device | |
CN108664505A (en) | A kind of deriving method and device of database table structure | |
CN104536687B (en) | A kind of page turning terminal | |
CN103593118A (en) | Irregular figure bookmark adding method and system based on Android platform reader | |
CN107818548A (en) | A kind of image processing method, device, equipment and computer-readable medium | |
CN104243942A (en) | Image processing method and image processing device | |
CN106843646A (en) | A kind of application icon based on mobile terminal searches control method and system | |
CN103606175B (en) | The display packing of a kind of map hotspot icon and controller |
Legal Events
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20171215 |
|
RJ01 | Rejection of invention patent application after publication |