Sponsored Content
Top Forums Shell Programming and Scripting search information in multiple files and save in new files Post 302720287 by msabhi on Tuesday 23rd of October 2012 05:11:04 PM
Old 10-23-2012
Code:
awk 'BEGIN{RS="LOCUS"}/Equinodermata/{print "LOCUS"$0 > FILENAME"_found"}' *gbk

your search patterns if found in a file say something.gbk, will be written into a new unique file something.gbk_found
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Multiple search string in multiple files using awk

Hi, filenames: contains name of list of files to search in. placelist contains the names of places to be searched in all files in "filenames" for i in $(<filenames) do egrep -f placelist $i if ] then echo $i fi done >> outputfile Output i am getting: (0 Replies)
Discussion started by: pinnacle
0 Replies

2. Shell Programming and Scripting

Merging information from multiple files to a single file

Hello, I am new to unix and need help with a problem. I have 2 files each containing multiple columns of information ie; File 1 : A B C D E 1 2 3 4 5 File 2 : F G 6 7 I would like to merge the information from File 2 to File 1 so that the data reads as follows; File 1: A... (4 Replies)
Discussion started by: crunchie
4 Replies

3. Shell Programming and Scripting

Search multiple patterns in multiple files

Hi, I have to write one script that has to search a list of numbers in certain zipped files. For eg. one file file1.txt contains the numbers. File1.txt contains 5,00,000 numbers and I have to search each number in zipped files(The number of zipped files are around 1000 each file is 5 MB) I have... (10 Replies)
Discussion started by: vsachan
10 Replies

4. Solaris

How to search for a word in multiple files

Hi, I want to find for a particular word which is existing in different files and folders under the parent directory. What command can I use to retrieve all the file names which is having the word. (1 Reply)
Discussion started by: rogerben
1 Replies

5. Shell Programming and Scripting

extracting information from multiple files

Hello there, I am trying to extract (string) information ( a list words) from 4 files and then put the results into 1 file. Currently I am doing this using grep -f list.txt file1 . and repeat the process for the other 3 files. The reasons i am doing that (a) I do know how to code (b) each file... (4 Replies)
Discussion started by: houkto
4 Replies

6. Shell Programming and Scripting

reading information from a table and apply a command on multiple files

Hey gyuz, I wanna calculate the number of mapped reads of a bam file in a region of interest. I used this code to do so : samtools view input.bam chrname:region1 > region1.txt This will store all the reads from given bam file within the region of interest in region1.txt Now I have... (5 Replies)
Discussion started by: @man
5 Replies

7. Shell Programming and Scripting

Search & Replace: Multiple Strings / Multiple Files

I have a list of files all over a file system e.g. /home/1/foo/bar.x /www/sites/moose/foo.txtI'm looking for strings in these files and want to replace each occurrence with a replacement string, e.g. if I find: '#@!^\&@ in any of the files I want to replace it with: 655#@11, etc. There... (2 Replies)
Discussion started by: spacegoose
2 Replies

8. Shell Programming and Scripting

Search and Replace in multiple files

Hello, I have hundreds of files in which I need to change email address. Here is what I am trying to do: 1. All text files are in a directory "a" 2. In the text file, I want to replace email address for preparer. All these lines start with {{PreparerEmail and end with }}. The email... (3 Replies)
Discussion started by: cartrider
3 Replies

9. Shell Programming and Scripting

Search for multiple files

I need to look for 3 files in a particular directory, if they are > 0kb. If files exist proceed further, if not mail out saying one of the file is missing. All the 3 files should be present. Please see my script below and correct if needed. Anyway, it is not working. #! /bin/bash... (13 Replies)
Discussion started by: Radfelder
13 Replies

10. UNIX for Beginners Questions & Answers

Issue with search and replacing multiple items in multiple files

Im having an issue when trying to replace the first column with a new set of values in multiple files. The results from the following code only replaces the files with the last set of values in val.txt. I want to replace all the files with all the values. for date in {1..31} do for val in... (1 Reply)
Discussion started by: ncwxpanther
1 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 04:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy