To output complete record with JOIN


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers To output complete record with JOIN
# 1  
Old 07-04-2008
To output complete record with JOIN

Hi

I have 2 files

file1

12312341231612634
34534368463786347
23472364287687263
23472357841007237

file2

12123561235176351*dhfsdhfh*2347623462*sdfjshehweu*123651235*sdgfsgfsy*23237346*
23472357841007237*defsjdf*12378234*hsdhfsdhgfsh*12837238947*dsjshgdfs*2348972348*
12312376234237868*fvdfvd*2342783239487*sdfsjefhsd*27236*sdhfsdhfs*2347234*

I want to use join in get those records that are present in file1 from file2 and want the complete line.

I dont want to use grep since the file size is high and it would take a long time to search for each record.

I am using Join

join -j1 1 -j2 1 file1 file2 -o ("I want complete row") cannot use 2.1 2.2 2.3 and so on as there are more than 100 fields.

Please suggest a solution.
# 2  
Old 07-04-2008
reply

Thanks got the output

join -t "*" -j1 1 -j2 1 file1 file2 > output

This wil give complete record.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

UNIX spool command not extracting complete record from the Oracle table

Hello All, I'm trying to spool an oracle table data into a csv file on unix server but the complete record is not being extracted. The record is almost 1000 characters but only 100 characters are being extracted and rest of the data getting truncated. I'm setting below options : SET... (4 Replies)
Discussion started by: venkat_reddy
4 Replies

2. Shell Programming and Scripting

How to join output of two command in same line?

Hi I am trying to figureout how to join output of two command in unix in the same line. for e.g. $ankit : df -h | egrep -w /home | awk '{print -n $1 "\t" $5}' ;stat --format=%a /home Output: 0148G /home 775 I want this output as... 0148G /home 775 Please let me know if you... (7 Replies)
Discussion started by: kotak86
7 Replies

3. Shell Programming and Scripting

Ps complete output

HI ALl I am creating a script where i can print ps output to find out most CPU utilised process.but in ps -ef we can get arg list only up to 80 character. ps -ef | more UID PID PPID C STIME TTY TIME CMD root 0 0 0 Feb 20 ? 0:40 sched root ... (3 Replies)
Discussion started by: devesh123
3 Replies

4. UNIX for Dummies Questions & Answers

How to use the join command to obtain tab delimited text files as an output?

How do you use the join command and obtain tab delimited text files as an output? Thanks! (2 Replies)
Discussion started by: evelibertine
2 Replies

5. Linux

perl program to delete the complete record

Hi all, I want a perl program to delete the record and its contents from a file if there is no particular line in the record given that all records are separated by a blank line. For example: #100 abcd efgh hijk 123 klm #200 abcd efgh hijk klm So, the pattern here is 123. If... (0 Replies)
Discussion started by: kaav06
0 Replies

6. Shell Programming and Scripting

Remove newline character or join the broken record

Hi, I have a very huge file, around 1GB of data. I want to remove the newline characters in the file but not preceded by the original end delimiter {} sample data will look like this 1234567 abcd{} 1234sssss as67 abcd{} 12dsad3dad 4sdad567 abcdsadd{} this should look like this... (6 Replies)
Discussion started by: ratheeshjulk
6 Replies

7. Shell Programming and Scripting

join files cisco command output

We have two files with results of two commands of cisco: one file; showintstatus, have the following format: Gi2/6 servidorlij connected 176 full 1000 10/100/1000BaseTsecond file; showmacaddrestable, have the following format: * 162 0021.9b8d.073e dynamic Yes 0 ... (1 Reply)
Discussion started by: robonet
1 Replies

8. Shell Programming and Scripting

Complete Screen Output to Log File

Hi, I would need to log the whole screen ouput to a log file. All Inputs from the Agent, all echo´s and DBMS Outputs from the PL/SQL. Basicly everything what I can see during the run on the screen. I tried it already with #exec 2>$BASELOG/RUN.log #exec 1>$BASELOG/RUN.log #exec >... (1 Reply)
Discussion started by: enjoy
1 Replies

9. UNIX for Dummies Questions & Answers

BASH complete-filename & menu-complete together

Hi, Does anyone know how to make BASH provide a list of possible completions on the first tab, and then start cycling through the possibilites on the next tab? Right now this is what I have in my .bashrc: bind "set show-all-if-ambiguous on" bind \\C-o:menu-complete This allows... (0 Replies)
Discussion started by: Mithu
0 Replies

10. UNIX for Dummies Questions & Answers

seaching field and getting complete record

hi, I have a file..... 1|3|4|5|6 1|3|4|4|5 now i ahave to search for value 4 in forth field and write that output to a file. if i do grep 4 file1 both lines are coming to output. can somebody help me building command. thanks and regards sandeep (4 Replies)
Discussion started by: mahabunta
4 Replies
Login or Register to Ask a Question