Sponsored Content
Top Forums Shell Programming and Scripting Help with matching entries in multiple files Post 302605563 by agama on Wednesday 7th of March 2012 06:42:23 PM
Old 03-07-2012
For completeness, mods to my original suggestion to print all matching data on one physical line.

Code:
sort data*  | awk -v expect=6 '
    function p( )   # print them if there was one in each file. 
    {
            if( have == expect )
                    printf( "%s\n", buffer )
            have = 0;
    }

    {
        if( buffer && $1 != last )          # next group; print last group if in all files
            p();

        last = $1;

        have++;
        buffer = buffer " " $0;
    }
    END { p(); }
'

This User Gave Thanks to agama For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Matching lines across multiple csv files and merging a particular field

I have about 20 CSV's that all look like this: "","","","","","","","","","","","","","","",""What I've been told I need to produce is the exact same thing, but with each file now containing the start_code from every other file where the email matches. It doesn't matter if any of the other... (1 Reply)
Discussion started by: Demosthenes
1 Replies

2. Shell Programming and Scripting

Removing matching text from multiple files with a shell script

Hello all, I am in need of assistance in creating a script that will remove a specified block of text from multiple .htaccess files. (roughly 1000 files) I am attempting to help with a project to clean up a linux server that has a series of unwanted url rewrites in place, as well as some... (4 Replies)
Discussion started by: boxx
4 Replies

3. Shell Programming and Scripting

Matching multiple fields from two files and then some?

Hi, I am working with two tab-delimited files with multiple columns, formatted as follows: File 1: >chrom 1 100 A G 20 …(10 columns) >chrom 1 104 G C 18 …(10 columns) >chrom 2 28 T C ... (4 Replies)
Discussion started by: mbp
4 Replies

4. Shell Programming and Scripting

Split single file into multiple files using pattern matching

I have one single shown below and I need to break each ST|850 & SE to separate file using unix script. Below example should create 3 files. We can use ST & SE to filter as these field names will remain same. Please advice with the unix code. ST|850 BEG|PO|1234 LIN|1|23 SE|4 ST|850... (3 Replies)
Discussion started by: prasadm
3 Replies

5. Shell Programming and Scripting

Creating single pattern for matching multiple files.

Hi friends, I have a some files in a directory. for example 856-abc 856-def 851-abc 945-def 956-abc 852-abc i want to display only those files whose name starts with 856* 945* and 851* using a single pattern. i.e 856-abc 856-def 851-abc 945-def the rest of the two files... (2 Replies)
Discussion started by: Little
2 Replies

6. Shell Programming and Scripting

Copy files matching multiple conditions

Hello How do i copy files matching multiple conditions. Requirement is to search files starting with name abc* and def* and created on a particular date or date range given by the user and copy it to the destination folder. i tried with different commands. below one will give the list ,... (5 Replies)
Discussion started by: NarayanaPrakash
5 Replies

7. Shell Programming and Scripting

awk script issue redirecting to multiple files after matching pattern

Hi All I am having one awk and sed requirement for the below problem. I tried multiple options in my sed or awk and right output is not coming out. Problem Description ############################################################### I am having a big file say file having repeated... (4 Replies)
Discussion started by: kshitij
4 Replies

8. Shell Programming and Scripting

Performance of calculating total number of matching records in multiple files

Hello Friends, I've been trying to calculate total number of a certain match in multiple data records files (DRs). Let say I have a daily created folders for each day since the beginning of july like the following drwxrwxrwx 2 mmsuper med 65536 Jul 1 23:59 20150701 drwxrwxrwx 2 mmsuper... (1 Reply)
Discussion started by: EAGL€
1 Replies

9. UNIX for Beginners Questions & Answers

Concatenate column values when header is Matching from multiple files

there can be n number of columns but the number of columns and header name will remain same in all 3 files. Files are tab Delimited. a.txt Name 9/1 9/2 X 1 7 y 2 8 z 3 9 a 4 10 b 5 11 c 6 12 b.xt Name 9/1 9/2 X 13 19 y 14 20 z 15 21 a 16 22 b 17 23 c 18 24 c.txt Name 9/1 9/2... (14 Replies)
Discussion started by: Nina2910
14 Replies

10. UNIX for Beginners Questions & Answers

Awk: matching multiple fields between 2 files

Hi, I have 2 tab-delimited input files as follows. file1.tab: green A apple red B apple file2.tab: apple - A;Z Objective: Return $1 of file1 if, . $1 of file2 matches $3 of file1 and, . any single element (separated by ";") in $3 of file2 is present in $2 of file1 In order to... (3 Replies)
Discussion started by: beca123456
3 Replies
YASKKSERV_MAKE_DICTIONARY(1)				      General Commands Manual				      YASKKSERV_MAKE_DICTIONARY(1)

NAME
yaskkserv_make_dictionary - dictionary converter for yaskkserv SYNOPSIS
yaskkserv_make_dictionary [OPTION] skk-dictionary output-dictionary DESCRIPTION
This manual page was written for the Debian GNU/Linux distribution because the original program does not have a manual page. yaskkserv is a dictionary server for the SKK Japanese input method system. yaskkserv is written in C++ from scratch in consideration of embedded environment, but is compatible with skkserv on the protocol behavior. yaskkserv_make_dictionary converts dictionary file of original format into that of yaskkserv format. OPTIONS
-a, --alignment enable alignment (default disable) -b, --block-size=SIZE set block size (default 8192) -d, --debug print debug information -h, --help print this help and exit -s, --short-block enable short block (must set --alignment) (default disable) -v, --version print version -a, --alignment enable alignment (default disable) -b, --block-size=SIZE set block size (default 8192) -d, --debug print debug information -h, --help print this help and exit -s, --short-block enable short block (must set --alignment) (default disable) -v, --version print version COPYRIGHT
Copyright (C) 2005, 2006, 2007, 2008 Tadashi Watanabe. SEE ALSO
yaskkserv_hairy(1), yaskkserv_normal(1), yaskkserv_simple(1). AUTHOR
yaskkserv was written by Tadashi Watanabe <wac@umiushi.org>. This manual page was written by KURASHIKI Satoru <lurdan@gmail.com>, for the Debian project (but may be used by others). January 17, 2008 YASKKSERV_MAKE_DICTIONARY(1)
All times are GMT -4. The time now is 07:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy