Join On A String


 
Thread Tools Search this Thread
# 8  
There is no syntax error. I tried it myself.

Either it is mistyped, or he is using ancient solaris awk.
# 9  
yes nawk runs but I'm not getting any output

---------- Post updated at 03:53 PM ---------- Previous update was at 03:49 PM ----------

Yes nawk works but I'm not getting any output. hm
# 10  
Then the input you are using does not match the data you posted -- or is just taking ages to process because the files are enormous. Please post a relevant sample.

If the files are too large, you'll need to sort and join them anyway.

Last edited by Corona688; 10-11-2012 at 05:14 PM..
# 11  
Code:
a.log: RBOSK-374            AAA-B04-D16-K01
a.log: 0  XXX 602 14/1          R14A        
a.log: 2  XXX 119 128/1         R1B         
a.log: 3  XXX 119 128/1         R1B         
a.log: 4  XXX 119 128/1         R1B         
a.log: 5  XXX 231 201/1         R10B        
a.log: 6  XXX 231 201/1         R5C

Code:
b.log: RBOSK-70  NB9292 
b.log: RBOSK-374 NB2781 
b.log: RBOSK-73  JO1794 
b.log: RBOSK-83  OK1987  
b.log: RBOSK-85  LY1983

I would want to file "a" to be like this:
Code:
a.log: NB2781          AAA-B04-D16-K01      
a.log: 0  XXX 602 14/1          R14A        
a.log: 2  XXX 119 128/1         R1B         
a.log: 3  XXX 119 128/1         R1B         
a.log: 4  XXX 119 128/1         R1B         
a.log: 5  XXX 231 201/1         R10B        
a.log: 6  XXX 231 201/1         R5C


Last edited by Corona688; 10-12-2012 at 03:35 PM..
# 12  
do the a.log and b.log files actually contain the text "a.log: " and "b.log: " ?
 

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

awk - How to join the string with values

Hi, I'm a beginner in awk script. I've been trying to figure how to concatenate two string in input file using awk after the value is calculated. I'm trying to get this format Apple 5.2(10) Orange 4.4(8) Watermelon 3.10(30) Berries 10.2(20) The input file with the format fruit... (2 Replies)
Discussion started by: KCApple
2 Replies

2. UNIX for Dummies Questions & Answers

How to use the the join command to join multiple files by a common column

Hi, I have 20 tab delimited text files that have a common column (column 1). The files are named GSM1.txt through GSM20.txt. Each file has 3 columns (2 other columns in addition to the first common column). I want to write a script to join the files by the first common column so that in the... (5 Replies)
Discussion started by: evelibertine
5 Replies

3. Shell Programming and Scripting

sed or awk command to replace a string pattern with another string based on position of this string

here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb cat dump.sql INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies

4. UNIX for Dummies Questions & Answers

how to join two files using "Join" command with one common field in this problem?

file1: Toronto:12439755:1076359:July 1, 1867:6 Quebec City:7560592:1542056:July 1, 1867:5 Halifax:938134:55284:July 1, 1867:4 Fredericton:751400:72908:July 1, 1867:3 Winnipeg:1170300:647797:July 15, 1870:7 Victoria:4168123:944735:July 20, 1871:10 Charlottetown:137900:5660:July 1, 1873:2... (2 Replies)
Discussion started by: mindfreak
2 Replies

5. Shell Programming and Scripting

to extract string from main string and string comparison

continuing from my previous post, whose link is given below as a reference https://www.unix.com/shell-programming-scripting/171076-shell-scripting.html#post302573569 consider there is create table commands in a file for eg: CREATE TABLE `Blahblahblah` ( `id` int(11) NOT NULL... (2 Replies)
Discussion started by: vivek d r
2 Replies

6. Shell Programming and Scripting

Join lines with the same start string

I have the text like: DN11-001 Thats the first line which needs to be DN11-001 joined with the second line and also to DN11-001 the third line as they all begin with the same DN11-001 document number. DN11-002 The number of lines differ DN11-002 among the documents. DN11-005 It can also be... (10 Replies)
Discussion started by: andrejm
10 Replies

7. UNIX for Dummies Questions & Answers

Join 2 files with multiple columns: awk/grep/join?

Hello, My apologies if this has been posted elsewhere, I have had a look at several threads but I am still confused how to use these functions. I have two files, each with 5 columns: File A: (tab-delimited) PDB CHAIN Start End Fragment 1avq A 171 176 awyfan 1avq A 172 177 wyfany 1c7k A 2 7... (3 Replies)
Discussion started by: InfoSeeker
3 Replies

8. Programming

sql,multiple join,outer join issue

example sql: select a.a1,b.b1,c.c1,d.d1,e.e1 from a left outer join b on a.x=b.x left outer join c on b.y=c.y left outer join d on d.z=a.z inner join a.t=e.t I know how single outer or inner join works in sql. But I don't really understand when there are multiple of them. can... (0 Replies)
Discussion started by: robbiezr
0 Replies

9. Shell Programming and Scripting

join (pls help on join command)

Hi, I am a new learner of join command. Some result really make me confused. Please kindly help me. input: file1: LEO oracle engineer 210375 P.Jones Office Runner ID897 L.Clip Personl Chief ID982 S.Round UNIX admin ID6 file2: Dept2C ID897 6 years Dept5Z ID982 1 year Dept3S ID6 2... (1 Reply)
Discussion started by: summer_cherry
1 Replies

10. Shell Programming and Scripting

Use of uninitialized value in join or string at arraydef.pl

When try to execute the following script, its throwing this error: " Use of uninitialized value in join or string at arraydef.pl line 17. " The script is : 1 #!/usr/bin/perl 2 3 use strict; 4 5 my @a = ( 1...10 ); 6 7 print " Original array : @a... (5 Replies)
Discussion started by: praveen_b744
5 Replies

Featured Tech Videos