Help in sorting and merging lists


 
Thread Tools Search this Thread
Top Forums Programming Help in sorting and merging lists
# 1  
Old 06-28-2010
Help in sorting and merging lists

Hi everyone, need your help in sorting and merging two numerical lists

Code:
Example:

I have one list 1 2 3 4 5 7 and the other 4 6 8, then the final output should be 1 2 3 4 5 6 7 8

Requesting your kind help in this

Regards,
RB Smilie
# 2  
Old 06-28-2010
Assume the two lists are in files: list1, list2
Code:
sort -n -u   list1 list2  > newfile

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sorting with list, - 2 lists next to 200

Hi I was wondering if anyone knew the best way to have files displayed by list so that they were in numerical order? the problem I am having is I am using the ls and the head command to sort a group of 500 files into manageable 133 file bunches and transfer them to another directory were they will... (4 Replies)
Discussion started by: Paul Walker
4 Replies

2. Shell Programming and Scripting

Merging and sorting files

I have the following files: file A Col1 Col2 A 1 B 2 C 3 D 4 file B Col1 Col2 A 1 Aa 1 B 2 C 3 D 4 file C Col1 Col2 A 1 (1 Reply)
Discussion started by: ramky79
1 Replies

3. Shell Programming and Scripting

Strange situation of file sorting and merging

I have a strange situation of sorting and merging two files based on similar columns previusly both files has same count of records so, I made below way which is working fine until they reduced the count of one files . I.e. some times the count of records of both will same and some times it... (16 Replies)
Discussion started by: manas_ranjan
16 Replies

4. Shell Programming and Scripting

get the lists

I expert, I may cross post something similar but I dirtyed my quesion somehow to be clear in the thread #cat file1 88dee gcc: Grok for callconvention-hard to enable hard float a2ad2 eglibc: package mtrace separately 61487 python: bump PR of packages after update of distutils.bbclass... (1 Reply)
Discussion started by: yanglei_fage
1 Replies

5. Shell Programming and Scripting

Merging two files with merging line by line

Hi, I have two files and i want to merge it like, file1.txt --------- abc cde efg file2.txt ------- 111 222 333 Output file should be, -------------- abc 111 (2 Replies)
Discussion started by: rbalaj16
2 Replies

6. UNIX for Dummies Questions & Answers

Sorting and merging files.

Hi I’m new to scripting and have only had about two days experience with this. I have questions about a bash/gawk script. Problem: I have 27 files, which needs to get merged into one, the files are separated into 8 subdivisions containing a 3 row data description. Example of data File.1 ... (7 Replies)
Discussion started by: Bateman1001
7 Replies

7. Shell Programming and Scripting

Using foreach with two lists

Hi everybody, I'm trying to use a foreach command with two lists. The file.txt looks like this: var1: 100 200 300 var2: 3 6 9 I'm trying to use a foreach command to associate the two variables together. My script looks like this: #! /bin/tcsh set a=(`cat file.txt | grep 'var1' | cut -d... (8 Replies)
Discussion started by: SimonWhite
8 Replies

8. Shell Programming and Scripting

Shell Script to Create non-duplicate lists from two lists

File_A contains Strings: a b c d File_B contains Strings: a c z Need to have script written in either sh or ksh. Derive resultant files (File_New_A and File_New_B) from lists File_A and File_B where string elements in File_New_A and File_New_B are listed below. Resultant... (7 Replies)
Discussion started by: mlv_99
7 Replies

9. Shell Programming and Scripting

How to get the files lists

Hi All, Need the help in getting the file list which are generated for the time period. example if i want to get the list of file generated between 11 to 12 clock. i used the find command search the files with -cmin flag with -60. find /home/test/* -cmin -60 -type f -exec ls {} \; ... (2 Replies)
Discussion started by: nmadhuhb
2 Replies
Login or Register to Ask a Question