Sponsored Content
Top Forums Shell Programming and Scripting awk help: Match data fields from 2 files & output results from both into 1 file Post 302742645 by Corona688 on Tuesday 11th of December 2012 11:33:24 AM
Old 12-11-2012
There's really no substitute for just using it until you're used to it.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

AWK Compare files, different fields, output

Hi All, Looking for a quick AWK script to output some differences between two files. FILE1 device1 1.1.1.1 PINGS device1 2.2.2.2 PINGS FILE2 2862 SITE1 device1-prod 1.1.1.1 icmp - 0 ... (4 Replies)
Discussion started by: stacky69
4 Replies

2. Shell Programming and Scripting

[Shell/Perl(?)] Prepending timestamps to console output & writing results to a file

I do a lot of TSM work and I embarked on what I thought would be an easy task, and I'd be very happy for any input to save the pounding my keyboard is receiving :] By default, the output of TSM's console has no timestamping, making it hard to sort through accurately. This puts my console into... (5 Replies)
Discussion started by: Vryali
5 Replies

3. Shell Programming and Scripting

AWK to match and merge data from 2 files into 1.

Hello, hopefully this is an easy on for the AWK guru's out there. I'm having some trouble figuring out how to match+merge data in 2 files into 1 single report. I've got my 2 files filtered and delimited, just need to MATCH $3 in file1 to $1 in file2, then put $0 from File1 and $2+$3 from File2... (6 Replies)
Discussion started by: right_coaster
6 Replies

4. Shell Programming and Scripting

awk to output match and mismatch with count using specific fields

In the below awk I am trying output to one file those lines that match between $2,$3,$4 of file1 and file2 with the count in (). I am also trying to output those lines that are missing between $2,$3,$4 of file1 and file2 with the count of in () each. Both input files are tab-delimited, but the... (7 Replies)
Discussion started by: cmccabe
7 Replies

5. Shell Programming and Scripting

awk to print fields that match using conditions and a default value for non-matching in two files

Trying to use awk to match the contents of each line in file1 with $5 in file2. Both files are tab-delimited and there may be a space or special character in the name being matched in file2, for example in file1 the name is BRCA1 but in file2 the name is BRCA 1 or in file1 name is BCR but in file2... (6 Replies)
Discussion started by: cmccabe
6 Replies

6. Shell Programming and Scripting

awk to print match or non-match and select fields/patterns for non-matches

In the awk below I am trying to output those lines that Match between file1 and file2, those Missing in file1, and those missing in file2. Using each $1,$2,$4,$5 value as a key to match on, that is if those 4 fields are found in both files the match, but if those 4 fields are not found then missing... (0 Replies)
Discussion started by: cmccabe
0 Replies

7. UNIX for Beginners Questions & Answers

Match Fields between two files, print portions of each file together when matched in ([g]awk)'

I've written an awk script to compare two fields in two different files and then print portions of each file on the same line when matched. It works reasonably well, but every now and again, I notice some errors and cannot seem to figure out what the issue may be and am turning to you for help. ... (2 Replies)
Discussion started by: jvoot
2 Replies

8. Shell Programming and Scripting

awk move select fields to match file prefix in two directories

In the awk below I am trying to use the file1 as a match to file2. In file2 the contents of $5,&6,and $7 (always tab-delimited) and are copied to the output under the header Quality metrics. The below executes but the output is empty. I have added comments to help and show my thinking. Thank you... (0 Replies)
Discussion started by: cmccabe
0 Replies

9. Shell Programming and Scripting

awk to update file based on match in 3 fields

Trying to use awk to store the value of $5 in file1 in array x. That array x is then used to search $4 of file1 to find aa match (I use x to skip the header in file1). Since $4 can have multiple strings in it seperated by a , (comma), I split them and iterate througn each split looking for a match.... (2 Replies)
Discussion started by: cmccabe
2 Replies

10. UNIX for Beginners Questions & Answers

awk match two fields in two files

Hi, I have two TEST files t.xyz and a.xyz which have three columns each. a.xyz have more rows than t.xyz. I will like to output rows at which $1 and $2 of t.xyz match $1 and $2 of a.xyz. Total number of output rows should be equal to that of t.xyz. It works fine, but when I apply it to large... (6 Replies)
Discussion started by: geomarine
6 Replies
iconv_zh(5)							File Formats Manual						       iconv_zh(5)

NAME
iconv_zh - code set conversion tables DESCRIPTION
The following code set conversions are supported: Code Set Conversions Supported Code Symbol TargetCode Symbol GB 2312-80 zh_CN.euc UTF-8 UTF-8 GB 2312-80 zh_CN.euc HZ-GB-2312 HZ-GB-2312 GB 2312-80 zh_CN.euc ISO-2022-CN zh_CN.iso2022-CN GBK zh_CN.gbk UTF-8 UTF-8 GBK zh_CN.gbk HZ-GB-2312 HZ-GB-2312 GBK zh_CN.gbk ISO-2022-CN zh_CN.iso2022-CN GB18030-2000 zh_CN.gb18030 UTF-8 UTF-8 GB18030-2000 zh_CN.gb18030 IS0-2022-CN zh_CN.iso2022-CN HZ-GB-2312 HZ-GB-2312 UTF-8 UTF-8 HZ-GB-2312 HZ-GB-2312 GB 2312-80 zh_CN.euc HZ-GB-2312 HZ-GB-2312 GBK zh_CN.gbk ISO-2022-CN zh_CN.iso2022-CN GB 2312-80 zh_CN.euc ISO-2022-CN zh_CN.iso2022-CN GBK zh_CN.gbk ISO-2022-CN zh_CN.iso2022-CN GB18030-2000 zh_CN.gb18030 IS0-2022-CN zh_CN.iso2022-CN UTF-8 UTF-8 Code Page 935 zh_CN-cp935 UTF-8 UTF-8 UTF-8 UTF-8 GB 2312-80 zh_CN.euc UTF-8 UTF-8 GBK zh_CN.gbk UTF-8 UTF-8 GB18030-2000 zh_CN.gb18030 UTF-8 UTF-8 HZ-GB-2312 HZ-GB-2312 UTF-8 UTF-8 IS0-2022-CN zh_CN.iso2022-CN UTF-8 UTF-8 Code Page 935 zh_CN-cp935 GB 2312-80 zh_CN.euc Big-5 zh_TW-big5 GBK zh_CN.gbk Big-5 zh_TW-big5 GBK zh_CN.gbk Big-5p zh_TW-big5p GBK zh_CN.gbk BIG5HK zh_HK-big5hk GB18030-2000 zh_CN.gb18030 Big-5 zh_TW-big5 GB18030-2000 zh_CN.gb18030 Big-5p zh_TW-big5p GB18030-2000 zh_CN.gb18030 BIG5HK zh_HK-big5hk Big-5 zh_TW-big5 GB18030-2000 zh_CN.gb18030 Big-5 zh_TW-big5 GBK zh_CN.gbk Big-5 zh_TW-big5 GB 2312-80 zh_CN.euc Big-5p zh_TW-big5p GB18030-2000 zh_CN.gb18030 Big-5p zh_TW-big5p GBK zh_CN.gbk BIG5HK zh_HK-big5hk GB18030-2000 zh_CN.gb18030 BIG5HK zh_HK-big5hk GBK zh_CN.gbk Conversion are performed as described below, For all conver- sions, if the source code set includes characters not inclu- ded in the target code set, conversion and output for all such characters will be done using a substitute characters. zh_CN.euc to UTF-8 and UTF-8 to zh_CN.euc Conversion modules can be used to convert GB 2312-80 characters between EUC-CN and UTF-8 encodings. If input data which does not have the corresponding character in the target code is encountered, it will be replaced with the substitute character (zh_CN.euc: '??' (0x3f3f), UTF-8: U+FFFD(0xefbfbd)). zh_CN.gbk to UTF-8 and UTF-8 to zh_CN.gbk Conversion modules can be used to convert GBK characters between GBK and UTF-8 encodings. If input data which does not have the correspond- ing character in the target code is encountered, it will be replaced with the subsitute character (zh_CN.gbk: '??' (0x3f3f), UTF-8: U+FFFD(0xefbfbd)). zh_CN.gb18030 to UTF-8 and UTF-8 to zh_CN.gb18030 Conversion modules can be used to convert GB18030-2000 characters between GB18030 and UTF-8 encodings. If input data which does not have the corresponding character in the target code is encountered, it will be replaced with the substitute character (zh_CN.GB18030: '??' (0x3f3f), UTF-8: U+FFFD(0xefbfbd)). zh_CN.euc to zh_CN.iso2022-CN and zh_CN.iso2022-CN to zh_CN.euc Conversion modules are provided to convert GB 2312-80 characters between IS0-2022-CN and EUC-CN encodings. zh_CN.gbk to zh_CN.iso2022-CN and zh_CN.iso2022-CN to zh_CN.euc Conversion modules are provided to convert GB 2312-80, CNS 11643-1992 plane 1 and 2 characters between ISO-2022-CN and EUC-CN encoding. If input data which doesn't belong to above charset is encountered, it will be replaced with the substitute character (zh_CN.gbk: 0xa1f5, zh_CN.iso2022-CN: 0x2175). zh_CN.euc to HZ-GB-2312 and HZ-GB-2312 to zh_CN.euc Conversion modules are provided to convert GB 2312-80 characters between EUC-CN and HZ encodings. zh_CN.gbk to HZ-GB-2312 and HZ-GB-2312 to zh_CN.gbk Conversion modules are provided to convert GB 2312-80 characters between EUC-CN and HZ encodings. If input data which does not belong to the above charset is encountered, it will be replaced with the substitute characters (HZ-GB-2312: 0x2175). zh_CN.iso2022-CN to UTF-8 and UTF-8 to zh_CN.iso2022-CN Conversion modules are provided to convert GB 2312-80 and CNS 11643 plane 1 and 2 characters between ISO-2022-CN and UTF-8 encodings. If input data which does not belong to the above charsets is encountered, it will be replaced with the substitute characters (zh_CN.iso2022-CN: '??' (0x3f3f), UTF-8: U+FFFD). HZ-GB-2312 to UTF-8 and UTF-8 to HZ-GB-2312 Conversion modules can be used to convert GB 2312-80 characters between HZ and UTF-8 encoding. If input data which does not belong to the above charset is encountered, it will be replaced with the substitute characters ( HZ-GB-2312: '??' (0x3f3f), UTF-8: U+FFFD). zh_CN-cp935 to UTF-8 and UTF-8 to zh_CN-cp935 Conversion modules are provided to convert GB 2312-80 characters between IBM Code Page 935 and UTF-8 encodings. zh_CN.euc to zh_TW-big5 and zh_TW-big5 to zh_CN.euc Conversion modules are provided to convert between simplified chinese (EUC-CN encoding) and traditional chinese (BIG5 encoding). If input data which does not have corresponding simplified/traditional chinese character is encountered, it will be replaced with the substitute character (zh_CN.euc: '__' (0x5f5f), zh_TW-big5: '__' (0x5f5f)). zh_CN.gbk to zh_TW-big5 and zh_TW-big5 to zh_CN.gbk Conversion modules are provided to convert GBK characters between GBK and BIG5 encoding. If input data which neither has corresponding sim- plified/traditional chinese character nor belongs to the other charset is encountered, it will be replaced with the substitute character (zh_CN.gbk: '__' (0x5f5f), zh_TW-big5: '__' (0x5f5f)). zh_CN.gbk to zh_TW-big5p and zh_TW-big5p to zh_CN.gbk Conversion modules can be used to convert GBK or Big-5p characters between GBK and Big-5p encodings. If input data which does not belong to the other charset, it will be replaced with the substitute character (zh_CN.gbk: '__' (0x5f5f), zh_TW-big5p: '__' (0x5f5f)). zh_CN.gbk to zh_HK-big5hk and zh_HK-big5hk to zh_CN.gbk Conversion modules can be used to convert GBK characters between GBK and BIG5HK encodings. if input data which does not belong to the other charset, it will be replaced with the substitute character (zh_CN.gbk: '__' (0x5f5f), zh_HK-big5hk: '__' (0x5f5f)). SEE ALSO
iconv(1), iconv(3), iconv(5), iconv_zh_TW(5) 2 Nov 2001 iconv_zh(5)
All times are GMT -4. The time now is 10:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy