Merge of two files

Merge of two files

Post by hp.. » Tue, 23 Jun 1998 04:00:00



I got a few questions:

I got two files each one gots a column in common, i want to use it to link the two files in order to get just one big file with important information in both archives, another problem is that in one of the files this "key column" what i want to use got the "key value" repeated so one of the goals is to get all the same values in one block then get the same value in the other file and put it right below the first block and so on with the rest of the values in both files.

How can i put a variable inside an expresion value, you know the one berween slashes "/" in order to execute an specific pattern "{}".

I want to sing up to a good mail list where i can expose this kind of problems.

Thanks in advance, Franklin Castillo

  --------------------------------------------------------------------
  Posted using Reference.COM                  http://WWW.Reference.COM
  FREE Usenet and Mailing list archive, directory and clipping service
  --------------------------------------------------------------------

 
 
 

Merge of two files

Post by Jim Mont » Tue, 23 Jun 1998 04:00:00



> I got two files each one gots a column in common, i want to use it to link
> the two files in order to get just one big file with important information
> in both archives, another problem is that in one of the files this "key
> column" what i want to use got the "key value" repeated so one of the goals
> is to get all the same values in one block then get the same value in the
> other file and put it right below the first block and so on with the rest of
> the values in both files.

Use the Unix commands sort and join to perform the relational database join,
then use sed, awk, etc. to transform the result set. If you MUST write a
relational database program in awk, see _The AWK Programming Language_
for a good model.

Quote:> How can i put a variable inside an expresion value, you know the one berween
> slashes "/" in order to execute an specific pattern "{}".

Read the FAQs for both comp.lang.awk and comp.unix.shell. The short,
(non)answer is, there are several ways.

Quote:> I want to sing up to a good mail list where i can expose this kind of
> problems.

Subscribe to comp.lang.awk and comp.unix.shell.

--
Jim Monty

Tempe, Arizona USA

 
 
 

1. How to merge two columns of numbers from two different files?

Hi there:

        I have two data files which have more than a few columns of numbers.
I want to pick certain column from each file and merge them together into a
third file.  How to do this?  Too bad awk only takes one input file

Regards

2. Are NE1000 know to give problems?

3. Can I merge two files into one?

4. Editors.

5. Sorting two files, then merging

6. Iomega JAZ mounting...

7. Need to regularly merge two passwd files

8. Apache 1.2.0, mod_perl & SSL Probs

9. ** Merging Two Text Files Parallel **

10. Merging two TXT files

11. How to merge two files with awk

12. Looking for sample code to merge two files.