Sponsored Content
Top Forums Shell Programming and Scripting Merge of two input file by search Post 302588246 by kykyboss on Saturday 7th of January 2012 08:06:13 PM
Old 01-07-2012
hi

thanks again this time it work better, but the ouput is duplicated because i need to do the search for "
Code:
:D33963,

and not only D33963 (as they could duplicated) how can i modify this ?

---------- Post updated at 07:22 PM ---------- Previous update was at 07:20 PM ----------
Code:
E00284|BNS Default Swap|154181.478745804|:E00284|48082|||Trading|FALSE||CAISSE|19149|AA|CAD||||||||2919966|FALSE||||BNS|||E|CA|CA|OTH_CBR|Call|Asset Asian|8000000.00|408|OTC-EQUITY OPT-SLD-TRA-EX||Options|Derivatives|||48082||False||||Sell|||||||||||||||||||||||||||||
E00284|BNS Default Swap|154181.478745804|:E00284CAP|48082|||Trading|FALSE||CAISSE|19149|AA|CAD||||||||2919966|FALSE||||BNS|||E|CA|CA|OTH_CBR|Call|Asset Asian|11040000.00|408|OTC-EQUITY OPT-SLD-TRA-EX||Options|Derivatives|||48082||False||||Buy|||||||||||||||||||||||||||||
E00286|BNS Default Swap|-21180.9904679111|:E00286|48082|||Trading|FALSE||CAISSE|19149|AA|CAD||||||||2919966|FALSE||||BNS|||E|CA|CA|OTH_CBR|Call|Asset Asian|10000000.00|653|OTC-EQUITY OPT-SLD-TRA-EX||Options|Derivatives|||48082||False||||Sell|||||||||||||||||||||||||||||
E00286|BNS Default Swap|-21180.9904679111|:E00286CAP|48082|||Trading|FALSE||CAISSE|19149|AA|CAD||||||||2919966|FALSE||||BNS|||E|CA|CA|OTH_CBR|Call|Asset Asian|14500000.00|653|OTC-EQUITY OPT-SLD-TRA-EX||Options|Derivatives|||48082||False||||Buy|||||||||||||||||||||||||||||
E00287|BNS Default Swap|-261564.923909249|:E00287|48082|||Trading|FALSE||92767||Internal|CAD||||||||2920257|FALSE||||BNS|||E|CA|CA|OTH_CBR|Call|Asset Asian|1992000.00|647|||Options|Derivatives|||48082||False||||Sell|||||||||||||||||||||||||||||

---------- Post updated at 07:37 PM ---------- Previous update was at 07:22 PM ----------

ok cool i found it thnaks a lot

Code:
$file1{ ":$field1," } = $line;

---------- Post updated at 08:06 PM ---------- Previous update was at 07:37 PM ----------

one more question after i stop how can i create a second output that will copy recoord for <file1> that doesn't match in <File2> with your previous code

Last edited by zaxxon; 01-07-2012 at 08:44 PM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

search file, change existing value based on input (awk help)

I have a file (status.file) of the form: valueA 3450 valueB -20 valueC -340 valueD 48 I am tailing a data.file, and need to search and modify a value in status.file...the tail is: tail -f data.file | awk '{ print $3, ($NF - $(NF-1)) }' which will produce lines that look like this: ... (3 Replies)
Discussion started by: nortonloaf
3 Replies

2. Shell Programming and Scripting

Using an input (?) file to search another

I have a file (DCN.txt) that has about 35000 lines. It looks like: 10004470028 10005470984 10006470301 10007474812 .... I have several other files (a11.txt, a12.txt, a12_1.txt, a13.txt, etc. about 70, each 100 mb large) that have history records like so: LINE 10005470984 01/06/2010... (13 Replies)
Discussion started by: oriqin
13 Replies

3. Solaris

Keyword search input from a file

Hi, I have a file which got only one column and got some keywords. I have another file where the keywords used in the first file are repeated in the second file. Now I would like to know how many times each keyword from the first file is repeated in the second file. Request your help on... (1 Reply)
Discussion started by: pointers
1 Replies

4. Shell Programming and Scripting

Read input files and merge them in given order and write them to input one param or one file

Dear Friends, I am looking for a shell script to merge input files into one file .. here is my idea: 1st paramter would be outfile file (all input files content) read all input files and merge them to input param 1 ex: if I pass 6 file names to the script then 1st file name as output file... (4 Replies)
Discussion started by: hyd1234
4 Replies

5. Shell Programming and Scripting

Bash to search file based off user input then create new file

In the below bash a file is downloaded when the program is opened and then that file is searched based on user input and the result is written to a new file. For example, the bash is opened and the download.txt is downloaded, the user then enters the id (NA04520). The id is used to search... (5 Replies)
Discussion started by: cmccabe
5 Replies

6. Shell Programming and Scripting

UNIX Scripting help to input string and search a file to find

Hi everyone, I am new to Unix and need help writing a script that can ask user for an input, then search that input within a file I know will have to use the read and grep commands, anyone can give me somewhere to start would help Task: Write a script to display which volume pool a given... (1 Reply)
Discussion started by: 12ic11
1 Replies

7. Shell Programming and Scripting

UNIX Scripting help to input string and search a file to find

Hi Don, this is not homework question. I work for a Credit card company and my development goal this year is to learn Unix. I would love if others can help me get started, thanks. Hi everyone I am new to Unix and need help writing a script that can ask user for an input, then search that input... (2 Replies)
Discussion started by: 12ic11
2 Replies

8. Linux

Search a template file and replace with input

Hi I have a CommonTemplateStop.template file . Inside the file i need to replace the variables DepName and CompInsName with the values(Trade and TradeIns) specified in the script. I have written the below .sh script in linux server which will read the .template file and has to replace the 2... (8 Replies)
Discussion started by: samrat dutta
8 Replies

9. Shell Programming and Scripting

Search pattern in a file taking input from another file

Hi, Below is my requirement File1: svasjsdhvassdvasdhhgvasddhvasdhasdjhvasdjsahvasdjvdasjdvvsadjhv vdjvsdjasvdasdjbasdjbasdjhasbdasjhdbjheasbdasjdsajhbjasbjasbhddjb svfsdhgvfdshgvfsdhfvsdadhfvsajhvasjdhvsajhdvsadjvhasjhdvjhsadjahs File2: sdh hgv I need a command such that... (8 Replies)
Discussion started by: imrandec85
8 Replies

10. UNIX for Beginners Questions & Answers

Reducing input file size after pattern search

I have a very large file with millions of entries identified by @M. I am using the following script to "extract" entries based on specific strings/patterns: #!/bin/bash if ] then file=$1 else echo "Input_file passed as an argument $1 is NOT found." exit; fi MID=(NULL "string-1"... (10 Replies)
Discussion started by: Xterra
10 Replies
EMPTY-PAGE(1)							 ExactImage Manual						     EMPTY-PAGE(1)

NAME
empty-page - empty page detector of the ExactImage toolkit SYNOPSIS
empty-page [option...] {-i | --input} input-file empty-page {-h | --help} DESCRIPTION
ExactImage is a fast C++ image processing library. Unlike many other library frameworks it allows operation in several color spaces and bit depths natively, resulting in low memory and computational requirements. empty-page counts dark pixels of a black and white image and decides with a threshold whether the page is most probably empty, and thus can be removed from the image processing stream. OPTIONS
-i file, --input file Read image from the specified file. -m n, --margin n Set width of border margin to skip. For speed reasons, the margin has to be a multiple of 8. The default is 16. -p x, --percentage x Set fraction of permissible dark pixels. The default is 0.05 (5%). -h, --help Display help text and exit. EXAMPLES
$ empty-page -i test.tif The image has 75461 dark pixels from a total of 1060992 (7.11231%). non-empty EXIT STATUS
The exit status is 0 if the image is mostly white, 1 otherwise. SEE ALSO
exactimage(7) AUTHORS
Jakub Wilk <jwilk@debian.org> Wrote this manual page for the Debian system. http://www.exactcode.de/site/open_source/exactimage/ This manual page incorporates texts found on the ExactImage homepage. COPYRIGHT
This manual page was written for the Debian system (and may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or (at your option) any later version published by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL-2. empty-page 09/09/2013 EMPTY-PAGE(1)
All times are GMT -4. The time now is 07:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy