Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Merging two files baased on condition Post 302751693 by rdrtx1 on Friday 4th of January 2013 10:18:05 AM
Old 01-04-2013
try:
Code:
awk '
! a[$1] {a[$1]=$1}
{ for (i=2; i<=NF; i++) a[$1]=a[$1] OFS $i; }
END {for (i in a) print a[i]}
' File1 File2

This User Gave Thanks to rdrtx1 For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Merging two files

Hi I have a requirement like this. I have two files This is how data1.txt looks: EI3171280 38640658501 NENN2005-12-129999-12-312005-12-12HALL NANCY 344 CHENEY HIGHWAY ... (4 Replies)
Discussion started by: venommaker
4 Replies

2. Shell Programming and Scripting

merging files

Thanks in advance I have 2 files having key field in each.I would like to join both on common key.I have used join but not sucessful. The files are attached here . what i Want in the output is on the key field SLS OFFR . I have used join commd but not successful. File one ======= SNO ... (6 Replies)
Discussion started by: vakharia Mahesh
6 Replies

3. Shell Programming and Scripting

Help with merging files

i would like to merge two files that have the same format but have different data. i would like to create one output file that contains information from both the original files.:rolleyes: (2 Replies)
Discussion started by: joe black
2 Replies

4. Shell Programming and Scripting

merging of files.

Hi, I want to merge the two files on the basis of columns like... file 1 Data Key A 12 B 13 file2 Data Value A A1 A A2 B B1 B B2 (5 Replies)
Discussion started by: clx
5 Replies

5. Shell Programming and Scripting

Merging of all files based on a condition

Hi Friends, I am new to UNIX. I need to merge all the files(to FINAL.txt) in single directory based one condition. Out of all the files one of file will have specific value like :GF01: at any where in the file. so the file which is having :GF01: should be appended at the last. EX:... (5 Replies)
Discussion started by: arund_01
5 Replies

6. Shell Programming and Scripting

Merging two files with same name

Hello all, I have limited experience in shell scripting. Here goes my question: I have two directories that have same number of files with same file names i.e. consider 2 directories A and B. Both directories have files 1.txt, 2.txt...... I need to merge the file 1.txt of A with file 1.txt... (5 Replies)
Discussion started by: jaysean
5 Replies

7. Shell Programming and Scripting

Merging two files with condition

I have two files of the type 111 222 10 112 223 20 113 224 30 114 225 20 and 111 222 9 444 555 8 113 224 32 666 777 25 I want to merge files based on 1 and 2nd column. if 1st and 2nd column are unique in file 1 and 2 keep... (3 Replies)
Discussion started by: digipak
3 Replies

8. Shell Programming and Scripting

merging two files

file1.txt 1 2 10 11 56 57 7 8 43 44 and let's suppose that there is a file called file2.txt with 100 columns I want to produce a file3.txt with columns specified in file1.txt in that order (1,2,10,11,56,57,7,8,43,44) Thanks! (2 Replies)
Discussion started by: johnkim0806
2 Replies

9. Shell Programming and Scripting

Merging two files

Guys, I am having little problem with getting a daily report! The daily process that I do is as follows 1. Unload Header for the report from the systables to one unl file, say Header.unl 2. Unload the data from the required table/tables to another unl file, say Data.unl 3. Send a... (2 Replies)
Discussion started by: PikK45
2 Replies

10. Shell Programming and Scripting

Merging two files

Hi All , I have a scenario where we need to combine two files . Below are the sample files and expected output , File 1: 1|ab 1|ac 1|ae 2|ad 2|ac File 2: 1|xy 1|fc 2|gh 2|ku Output file : 1|ab|xy (3 Replies)
Discussion started by: saj
3 Replies
PAPS(1) 						      General Commands Manual							   PAPS(1)

NAME
paps - UTF-8 to PostScript converter using Pango SYNOPSIS
paps [options] files... DESCRIPTION
paps reads a UTF-8 encoded file and generates a PostScript language rendering of the file. The rendering is done by creating outline curves through the pango ft2 backend. OPTIONS
These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. --landscape Landscape output. Default is portrait. --columns=cl Number of columns output. Default is 1. --font=desc Set the font description. Default is Monospace 12. --rtl Do rtl layout. --paper ps Choose paper size. Known paper sizes are legal, letter, a4. Default is A4. --bottom-margin=bm Set bottom margin in postscript points (1/72 inch). Default is 36. --top-margin=tm Set top margin. Default is 36. --left-margin=lm Set left margin. Default is 36. --right-margin=rm Set right margin. Default is 36. --help Show summary of options. --header Draw page header for each page. --markup Interpret the text as pango markup. --encoding=ENCODING Assume the documentation encoding is ENCODING. --lpi Set the lines per inch. This determines the line spacing. --cpi Set the characters per inch. This is an alternative method of specifying the font size. --stretch-chars Indicates that characters should be stretched in the y-direction to fill up their vertical space. This is similar to the texttops behaviour. AUTHOR
paps was written by Dov Grobgeld <dov.grobgeld@gmail.com>. This manual page was written by Lior Kaplan <kaplan@debian.org>, for the Debian project (but may be used by others). April 17, 2006 PAPS(1)
All times are GMT -4. The time now is 03:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy