Awk file processing practices

Source: Internet
Author: User
The awk file processing small practice file contains three fields (sorted): Example: summary. the awk file processing small practice file contains three fields (sorted): example: news news_1 1234556 news news_1 1234557 news news_2 1234558 news news_2 1234559 sport sport_1 2234555 sport sprot_1 2234558 sport sport_2 2234556 sport sport_2 2234557 1 according to the first column, write the same data in the first column to the same file awk '{print $2, $3> $1}' file 2, and cut it into different After the file is created, the following SQL statements are constructed: (select * from news_1 where id in (1234556,123447) awk '{id [$1] = id [$1]? (Id [$1] "," $2): $2;} END {for (I in id) {print "select * from" I "_ post where id in (" id [I] ");"}'
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.