Linux -Blue forest free software | Return to home page | Site Map | Search WWW | Contact Us |
Your current position : Homepage > Free Software > Technological exchanges >Application Programming


    

Blue Forest http://www.lslnet.com at 11:18 on June 26, 2006


Eager, anxious to ask a question earlier version of the document

Sometimes several texts of documents, as the format is as follows :
IPPF Street Station ^^^^^^123456^ ^1#^ 1^1^ Yu-chuan
2^1^ Yu-chuan Street ^19#^ ending three branch ^^^^^^123456^
Post Street branch ^^^^^^123456^ ^41#^ 3^1^ Yu-chuan
Chen Yu-chuan Street ^69#^ 4^1^ kindergarten ^^^^^^123456^
5^1^ Yu-chuan Street Food Factory ^^^^^^123456^ ^80#^ year of the dragon
…………………………
3160^16^124 its silk factory dormitory ^19 modules ^ 2 ^ layer on the 2nd ^^^^^623456^
3161^16^124 No. ^ ^ layer silk factory dormitory unit on the 1st ^^^^^623456^ ^19
3162^16^124 No. ^ ^ layer silk factory dormitory unit on the 2nd ^^^^^623456^ ^19
3163^16^124 its silk factory dormitory ^19 modules ^ 4 ^ layer on the 1st ^^^^^623456^
3164^16^124 No. ^ ^ 4 layer silk factory dormitory unit on the 2nd ^^^^^623456^ ^19
3165^16^124 No. ^ ^ layer silk factory dormitory unit on the 1st ^^^^^623456^ ^19
3166^16^124 No. ^ ^ layer silk factory dormitory unit on the 2nd ^^^^^623456^ ^19
Even need to turn a few more papers, which plots the records deleted in the final document only keep one, not plots are entered into the final document, which records every trip to the field is not a comparison, only behind the field for all, but the final document required only the first field, each other. Ask what can solve this problem, AWK trip?

Eager, anxious to ask a question earlier version of the document

-->

Your "MM" Poor thing, how do you always ask awk, N times to answer questions, asking themselves.

Eager, anxious to ask a question earlier version of the document

Description of your text in the field is how to distinguish between the above ellipses

Eager, anxious to ask a question earlier version of the document

-->
If you do cattle, say how to solve

Eager, anxious to ask a question earlier version of the document

Eager, anxious to ask a question earlier version of the document

Lastly, you do not know, do not participate in a field, but also to request only if a field, behind the same field, you should be the one?
Records can be removed if the same combination of the following orders.
Sort $file | uniq "$tempfile

Eager, anxious to ask a question earlier version of the document

-->
Oh 呵~~~, lazy 呀!!!

Eager, anxious to ask a question earlier version of the document

-->
If a field, behind the same field, these two records are the same as, retaining only one record
: Part doing so, in the importation of two documents, one of them a choice of records, all records with another document, if the same, regardless of the records, records continue to the next test; If the records are different, then that record into a new document. When the first record all documents were detected End launch cycle. The second document, and the new document is the final result of the merger. Do what is good? If awk, awk nest if necessary, ask the experts, the feasibility of

Eager, anxious to ask a question earlier version of the document

-->
Shell is not the problem it used ah

Eager, anxious to ask a question earlier version of the document

-->
In an interview with the MM is, we want to help you, Do not see? Give you an idea that he changed, and there are many ways to achieve the
[code]# Cat 2.txt
3160^16^124 its silk factory dormitory ^19 modules ^ 2 ^ layer on the 2nd ^^^^^623456^
3161^16^124 No. ^ ^ layer silk factory dormitory unit on the 1st ^^^^^623456^ ^19
3162^16^124 No. ^ ^ layer silk factory dormitory unit on the 2nd ^^^^^623456^ ^19
3163^16^124 its silk factory dormitory ^19 modules ^ 2 ^ layer on the 2nd ^^^^^623456^
3164^16^124 No. ^ ^ 4 layer silk factory dormitory unit on the 2nd ^^^^^623456^ ^19
3165^16^124 No. ^ ^ layer silk factory dormitory unit on the 1st ^^^^^623456^ ^19
3166^16^124 No. ^ ^ layer silk factory dormitory unit on the 2nd ^^^^^623456^ ^19
# Sed 's/\^/@/' 2.txt |awk F '@' '! ($ 2 in i) (print) i[$2]; '|sed' s/\@/\^/ '
3160^16^124 its silk factory dormitory ^19 modules ^ 2 ^ layer on the 2nd ^^^^^623456^
3161^16^124 No. ^ ^ layer silk factory dormitory unit on the 1st ^^^^^623456^ ^19
3162^16^124 No. ^ ^ layer silk factory dormitory unit on the 2nd ^^^^^623456^ ^19
3164^16^124 No. ^ ^ 4 layer silk factory dormitory unit on the 2nd ^^^^^623456^ ^19
3165^16^124 No. ^ ^ layer silk factory dormitory unit on the 1st ^^^^^623456^ ^19
3166^16^124 No. ^ ^ layer silk factory dormitory unit on the 2nd ^^^^^623456^[/code] ^19

Eager, anxious to ask a question earlier version of the document

See the replacement of the ballots, compared with uniq -f1 to its second field behind

Eager, anxious to ask a question earlier version of the document

See the replacement of the ballots, compared with uniq -f1 to its second field behind



 Privacy Policy  Copyright © 1999-2000 LSLNET.COM. All rights reserved. Blue Forest website owners. E-mail : Webmaster@lslnet.com