Join two fixed length Files in Unix


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Join two fixed length Files in Unix
# 1  
Old 03-13-2007
Join two fixed length Files in Unix

Hi,

Can we join two fixed length files in Unix using JOIN command? Is there any other command to accomplish the same?

Thanks,
G.Harikrishnan
# 2  
Old 03-14-2007
Perhaps try paste.
# 3  
Old 03-14-2007
Maybe:
Code:
cat file1 file2 >> file3

# 4  
Old 03-14-2007
Quote:
Originally Posted by Ebbi
Maybe:
Code:
cat file1 file2 >> file3

Is this joining ? I think he wants to merge subsequent lines of files. So, he has to use "paste" to achieve that.
# 5  
Old 03-20-2007
Hi,

Basically i was looking for merge of two files based on matching key fields from two files (Sort of Inner Join in Oracle)

Thanks & Regards,
G.Harikrishnan
# 6  
Old 03-21-2007
Can you post the sample files?
# 7  
Old 03-21-2007
Sounds like some 'grep', 'sort' and 'cat' action to me.... Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Convert variable length record to fixed length

Hi Team, I have an issue to split the file which is having special chracter(German Char) using awk command. I have a different length records in a file. I am separating the files based on the length using awk command. The command is working fine if the record is not having any... (7 Replies)
Discussion started by: Anthuvan
7 Replies

2. Shell Programming and Scripting

Unix sort for fixed length columns and records

I was trying to use the AIX 6.1 sort command to sort fixed-length data records, sorting by specific columns only. It took some time to figure out how to get it to work, so I wanted to share the solution. The sort man page wasn't much help, because it talks about field delimeters (default space... (1 Reply)
Discussion started by: CheeseHead1
1 Replies

3. Shell Programming and Scripting

Help with extracting words from fixed length files

I am very new to scripting and need to write a script that will extract the account number from a line that begins with HDR. For example, the file is as follows HDR2010072600300405505100726 00300405505 LBJ FREEWAY DALLAS TELEGRAPH ... (9 Replies)
Discussion started by: bds052189
9 Replies

4. Shell Programming and Scripting

changing a variable length text to a fixed length

Hi, Can anyone help with a effective solution ? I need to change a variable length text field (between 1 - 18 characters) to a fixed length text of 18 characters with the unused portion, at the end, filled with spaces. The text field is actually field 10 of a .csv file however I could cut... (7 Replies)
Discussion started by: dc18
7 Replies

5. Shell Programming and Scripting

Make variable length record a fixed length

Very, very new to unix scripting and have a unique situation. I have a file of records that contain 3 records types: (H)eader Records (D)etail Records (T)railer Records The Detail records are 82 bytes in length which is perfect. The Header and Trailer records sometimes are 82 bytes in... (3 Replies)
Discussion started by: jclanc8
3 Replies

6. UNIX for Dummies Questions & Answers

What the command to find out the record length of a fixed length file?

I want to find out the record length of a fixed length file? I forgot the command. Any body know? (9 Replies)
Discussion started by: tranq01
9 Replies

7. Shell Programming and Scripting

Awk - Working with fixed length files

OK I am somewhat new to UNIX programming please see what you can do to help. I have a flat file that is a fixed length file containing different records based on the 1st character of each line. The 1st number at the beginning of the line is the record number, in this case it's record #1. I... (3 Replies)
Discussion started by: ambroze
3 Replies

8. Shell Programming and Scripting

Awk with fixed length files

Hi Unix Champs, I want to awk on a fixed length file. Instead if the file was a delimited file, then I could have used -F and then could have easily done manipulation on the fields. How do i do the same in case of fixed length file? Thanks in Advance. Regards. (7 Replies)
Discussion started by: c2b2
7 Replies

9. Shell Programming and Scripting

sort on fixed length files

Hi How to sort a fixed length file on a given char range and just display the duplicates. I did search for man sort to find any option but could find any.,something similar to cut -c 1-5,25-35. I have alternate way of doing this by using combination of cut,awk. but this creates extra temp... (6 Replies)
Discussion started by: sach_in
6 Replies

10. Shell Programming and Scripting

creating a fixed length output from a variable length input

Is there a command that sets a variable length? I have a input of a variable length field but my output for that field needs to be set to 32 char. Is there such a command? I am on a sun box running ksh Thanks (2 Replies)
Discussion started by: r1500
2 Replies
Login or Register to Ask a Question