Sponsored Content
Top Forums Shell Programming and Scripting Compare 2 files the send output to a file Post 302925518 by kekanap on Monday 17th of November 2014 04:17:20 PM
Old 11-17-2014
Compare 2 files the send output to a file

Hallo Friends,

I would like to compare two files, then write the difference between the two into output file then find a pattern then search for that pattern.

Code:
-bash-3.2$ cat BS_Orig_20141112.csv|head -20
BW0159574451211141638275086@196.35.130.5
BW02043750712111491637691@196.35.130.5
BW020421383121114-180930532@196.35.130.5
BW0201184681211141746103607@196.35.130.5
BW020345972121114-1681948760@196.35.130.5
BW020331222121114-294445536@196.35.130.5
BW020336971121114-355187974@196.35.130.5
BW020437153121114387863052@196.35.130.5
BW020353585121114103735320@196.35.130.5
BW020317092121114279456245@196.35.130.5
BW084013396121114511570322@196.35.130.5
BW103120541121114-1688959305@196.35.130.5
BW080047046121114711500840@196.35.130.5
BW080143363121114-1150959720@196.35.130.5
BW130524870121114-1387080302@196.35.130.5
-bash-3.2$ cat BS_Orig_20141112.csv|wc -l
1921373
-bash-3.2$

Code:
-bash-3.2$ cat missing_revenue_20141112.csv|head -20
BW0522168531211141180935668@196.23.110.141
BW092218784121114-370120610@196.23.110.141
BW1404407551211141874517771@196.23.110.141
BW001058223121114-2086341879@196.35.130.5
BW001126190121114-710205576@196.35.130.5
BW002549135121114563646299@196.35.130.5
BW0053227321211141454430109@196.35.130.5
BW020430589121114-1737491030@196.35.130.5
BW0206420091211141773544379@196.35.130.5
BW0439517101211141952205283@196.35.130.5
BW051813264121114-676811767@196.35.130.5
BW060319275121114790906797@196.35.130.5
BW061524500121114845368553@196.35.130.5
BW0617193031211141958558621@196.35.130.5
BW084013396121114511570322@196.35.130.5
BW103120541121114-1688959305@196.35.130.5
BW080047046121114711500840@196.35.130.5
BW080143363121114-1150959720@196.35.130.5
BW130524870121114-1387080302@196.35.130.5
bash-3.2$ cat missing_revenue_20141112.csv|wc -l
1226248
-bash-3.2$


i would like to compare the two files then place the difference into file_a.csv

Regards,

Pax
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

compare 2 files, output dups to file

I have two files that I want to compare and output a new file that will contain the duplicates. I have tried comm -12 and it doesn't work? Any help will be helpful. Thanks, Barbara (2 Replies)
Discussion started by: blt123
2 Replies

2. Shell Programming and Scripting

compare two col from 2 files, and output uniq from file 1

Hi, I can't find how to achive such thing, please help. I have try with uniq and comm but those command can't compare columns just whole lines, I think awk will be the best but awk is magic for me as of now. file a a1~a2~a3~a4~a6~a7~a8 file b b1~b2~b3~b4~b6~b7~b8 output 1: compare... (2 Replies)
Discussion started by: pp56825
2 Replies

3. Shell Programming and Scripting

Compare two files and output diff to third file

I have made several attempts to read two files of ip addresses and eliminate records from file1 that are in file2. My latest attempt follows. Everything works except my file3 is exactly the same as file1 and it should not be. # !/usr/bin/bash # # NoInterfaces # Utility will create a file... (8 Replies)
Discussion started by: altamaha
8 Replies

4. Shell Programming and Scripting

Compare 2 files and send output to other

Hi, In File1.txt I have text like: 23AA3424DD23|3423ff25sd5345| and so on In File2.txt I have similar text as File1, but with ",": 23aa3424dd23,192.168.1.100, and so on I wan to remove the pipes from File1 and select 5 fields, then remove "," from File2.txt and select 2 fields (IP's... (14 Replies)
Discussion started by: cameleon
14 Replies

5. Shell Programming and Scripting

awk to compare flat files and print output to another file

Hello, I am strugling from quite a some time to compare flat files with over 1 million records could anyone please help me. I want to compare two pipe delimited flat files, file1 with file2 and output the unmatched rows from file2 in file3 Sample File1: ... (9 Replies)
Discussion started by: suhaeb
9 Replies

6. UNIX for Advanced & Expert Users

Shell Script to compare xml files and print output to a file

All, PLease can you help me with a shell script which can compare two xml files and print the difference to a output file. I have attached one such file for you reference. <Group> <Member ID=":Year_Quad:41501" childCount="4" fullPath="PEPSICO Year-Quad-Wk : FOLDER.52 Weeks Ending Dec... (2 Replies)
Discussion started by: kanthrajgowda
2 Replies

7. Shell Programming and Scripting

Compare two files and output in another file

I have two files ' 1st one ALIC-000352-B ALIC-000916-O DDS-STNGD FDH-PPO1-001 PFG-30601-001 2nd one 'ALIC-000352-B' 'ALIC-000916-O' 'DDS-STNGD' 'FDH-PPO1-001' (4 Replies)
Discussion started by: Pratik4891
4 Replies

8. Shell Programming and Scripting

Compare columns of multiple files and print those unique string from File1 in an output file.

Hi, I have multiple files that each contain one column of strings: File1: 123abc 456def 789ghi File2: 123abc 456def 891jkl File3: 234mno 123abc 456def In total I have 25 of these type of file. (5 Replies)
Discussion started by: owwow14
5 Replies

9. UNIX for Dummies Questions & Answers

Compare two files and output to new file

Hi, Please help How to compare two files- Any mismatches 2nd and 3rd column's values corresponding to 1st column. file1 15294024|Not Allowed|null 15291398|Not Allowed|null 15303292|Dropship (standard)|N 15303291|Dropship (standard)|N 15275561|Store Only|Y 15275560|Store Only|Y... (2 Replies)
Discussion started by: Ankita Talukdar
2 Replies

10. UNIX for Dummies Questions & Answers

To compare two files,Output into a new file

Hi Please help me to compare two files and output into a new file file1.txt 15114933 |4001 15291649 |933502 15764675 |4316 15764678 |4316 15761974 |282501 15673104 |933505 15673577 |933505 15673098 |933505 15673096 |933505 15673092 |933505 15760705 ... (13 Replies)
Discussion started by: Ankita Talukdar
13 Replies
ftpservers(4)							   File Formats 						     ftpservers(4)

NAME
ftpservers - FTP Server virtual hosting configuration file SYNOPSIS
/etc/ftpd/ftpservers DESCRIPTION
The ftpservers file is used to configure complete virtual hosting. In contrast to limited virtual hosting, complete virtual hosting allows separate configuration files to be specified for each virtual host. The set of configuration files for each virtual host are placed in their own directory. The ftpservers file associates the address of each virtual host with the directory its configuration files are stored in. The virtual host configuration files must be named: ftpaccess Virtual host's access file ftpusers Restricts the accounts that can use the virtual host ftpgroups Virtual hosts enhanced group access file ftphosts Allow or deny usernames access to the virtual host ftpconversions Customize conversions available from the virtual host You do not need to put every file in each virtual host directory. If you want a virtual host to use the master copy of a file, then do not include it in the virtual host directory. If the file is not included, the master copy from the /etc/ftpd directory will be used. The file names must match exactly. If you misspell any of them or name them differently, the server will not find them, and the server will use the master copy instead. The ftpaddhost utility is an administrative tool to configure virtual hosts. See ftpaddhost(1M). File Format There are two fields to each entry in the ftpservers file: address directory-containing-configuration-files For example: 10.196.145.10 /etc/ftpd/virtual-ftpd/10.196.145.10 10.196.145.200 /etc/ftpd//virtual-ftpd/10.196.145.200 some.domain INTERNAL When an FTP client connects to the FTP Server, in.ftpd(1M) tries to match the IP address to which the FTP client connected with one found in the ftpservers file. The address can be an IPv4 or IPv6 address, or a hostname. If a match is found, The FTP server uses any configuration files found in the associated directory. If a match is not found, or an invalid directory path is encountered, the default paths to the configuration files are used. The use of INTERNAL in the example above fails the check for a specific directory, and the master configuration files will be used. Either the actual IP address or a specific hostname can be used to specify the virtual host. It is better to specify the actual IP of the virtual host, as it reduces the need for a domain lookup and eliminates DNS security related naming issues, for example: 10.196.145.20 /etc/ftpd/config/faqs.org/ ftp.some.domain /etc/ftpd/config/faqs.org/ Lines that begin with a # sign are treated as comment lines and are ignored. FILES
/etc/ftpd/ftpservers ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWftpr | +-----------------------------+-----------------------------+ |Interface Stability |External | +-----------------------------+-----------------------------+ SEE ALSO
ftpaddhost(1M), in.ftpd(1M), ftpaccess(4), ftpconversions(4), ftpgroups(4), ftphosts(4), ftpusers(4), attributes(5) SunOS 5.10 1 May 2003 ftpservers(4)
All times are GMT -4. The time now is 02:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy