Sponsored Content
Full Discussion: Help needed in sorting
Top Forums Shell Programming and Scripting Help needed in sorting Post 302452952 by sam127 on Monday 13th of September 2010 02:06:51 PM
Old 09-13-2010
Help needed in sorting

Hi, Please I need urgent help in sorting below data, I had similar post but there was a kind of space in between the data but now there is no space and I have tried adjusting the old script to work but it didn't.
here are the data;
Code:
traceroute to 2001:1ba0:2a0:5965:0:30:24:1 (2001:1ba0:2a0:5965:0:30:24:1), 30 hops max, 80 byte packets
 1  2001:630:301:1100::2  0.491 ms
 2  2001:630:301:7005::1  1.173 ms
 3  2001:630:302:c01::feed:1  1.182 ms
 4  2001:630:302:705::feed:1  1.710 ms
 5  2001:630:0:8045::601  3.087 ms
 6  2001:630:0:10::3e  6.241 ms
 7  2001:630:0:10::9a  6.539 ms
 8  2001:630:0:10::152  6.546 ms
 9  2001:7f8:4::7218:1  34.788 ms
10  2001:4de8:d1a1:1111:4::1  34.802 ms
11  2001:4de8:d1a1:1111:1f::2  34.641 ms
12  2001:4de8:d1a1:1111:11::2  39.970 ms
13  2001:1ba0:babe::1:2  40.120 ms
14  2001:1ba0:2a0:5965:0:30:24:1  40.136 ms
traceroute to 2001:8a8:21:5:216:3eff:fec1:423 (2001:8a8:21:5:216:3eff:fec1:423), 30 hops max, 80 byte packets
 1  2001:630:301:1100::2  0.674 ms
 2  2001:630:301:7005::1  0.866 ms
 3  2001:630:302:c01::feed:1  0.833 ms
 4  2001:630:302:705::feed:1  16.440 ms
 5  2001:630:0:8045::601  3.091 ms
 6  2001:630:0:10::3e  6.226 ms
 7  2001:630:0:10::9a  6.509 ms
 8  2001:630:0:10::152  6.516 ms
 9  2001:7f8:4::32e6:1  6.520 ms
10  2001:1620:2::9a  23.761 ms
11  2001:1620:2::8d  28.410 ms
12  2001:1620:2::1  28.392 ms
13  2001:7f8:24::f  28.539 ms
14  2001:8a8:1:2::30  28.545 ms
15  2001:8a8:1:b::74  28.670 ms
16  2001:8a8:21:5:216:3eff:fec1:423  28.642 ms
traceroute to 2a00:ec8:401:1:a032::1 (2a00:ec8:401:1:a032::1), 30 hops max, 80 byte packets
 1  2001:630:301:1100::2  0.928 ms
 2  2001:630:301:7005::1  0.743 ms
 3  2001:630:302:c01::feed:1  0.708 ms
 4  2001:630:302:705::feed:1  1.412 ms
 5  2001:630:0:8045::601  2.962 ms
 6  2001:630:0:10::3e  6.082 ms
 7  2001:630:0:10::8e  6.414 ms
 8  2001:798:28:10aa::1  6.667 ms
 9  2001:798:cc:2201:2801::1  14.741 ms
10  2001:798:cc:1401:2201::1  22.125 ms
11  2001:450:2002:70::1  22.243 ms
12  2001:450:2002:1ef::2  22.056 ms
13  2a00:ec8:401:211::1  22.180 ms
14  2a00:ec8:401:1:a032::1  22.346 ms
traceroute to 2001:470:895b::3 (2001:470:895b::3), 30 hops max, 80 byte packets
 1  2001:630:301:1100::2  5.884 ms
 2  2001:630:301:7005::1  0.876 ms
 3  2001:630:302:c01::feed:1  0.888 ms
 4  2001:630:302:705::feed:1  14.965 ms
 5  2001:630:0:8045::601  3.035 ms
 6  2001:630:0:10::3e  6.340 ms
 7  2001:630:0:10::9a  6.352 ms
 8  2001:630:0:10::152  6.580 ms
 9  2001:7f8:4::1b1b:1  6.766 ms
10  2001:470:0:3e::1  74.825 ms
11  2001:470:0:5d::2  77.773 ms
12  2001:470:895b::3  110.466 ms
traceroute to 2a00:ec8:401:1:a043::1 (2a00:ec8:401:1:a043::1), 30 hops max, 80 byte packets
 1  2001:630:301:1100::2  0.524 ms
 2  2001:630:301:7005::1  0.908 ms
 3  2001:630:302:c01::feed:1  0.915 ms
 4  2001:630:302:705::feed:1  1.462 ms
 5  2001:630:0:8045::601  3.202 ms
 6  2001:630:0:10::3e  6.205 ms
 7  2001:630:0:10::8e  6.612 ms
 8  2001:798:28:10aa::1  6.624 ms
 9  2001:798:cc:2201:2801::1  14.753 ms
10  2001:798:cc:1401:2201::1  22.057 ms
11  2001:450:2002:70::1  22.197 ms
12  2001:450:2002:1ef::2  22.012 ms
13  2a00:ec8:401:211::1  22.156 ms
14  2a00:ec8:401:1:a043::1  22.456 ms
traceroute to 2a02:750:0:501::102 (2a02:750:0:501::102), 30 hops max, 80 byte packets
 1  2001:630:301:1100::2  0.465 ms
 2  2001:630:301:7005::1  0.824 ms
 3  2001:630:302:c01::feed:1  0.832 ms
 4  2001:630:302:905::feed:1  2.142 ms
 5  2001:630:0:8040::601  4.904 ms
 6  2001:630:0:10::9a  74.637 ms
 7  2001:630:0:10::152  5.247 ms
 8  2001:7f8:4::1b1b:1  13.528 ms
 9  2001:470:0:3f::2  16.631 ms
10  2001:470:0:47::2  20.289 ms
11  2001:470:0:110::2  44.832 ms
12  2001:7f8:3e:0:a500:4:3948:1  53.290 ms
13  2a02:750::1:1  53.730 ms
14  2a02:750:0:501::102  55.805 ms
traceroute to 2001:888:12b4::a604:3001 (2001:888:12b4::a604:3001), 30 hops max, 80 byte packets
 1  2001:630:301:1100::2  0.730 ms
 2  2001:630:301:7005::1  1.071 ms
 3  2001:630:302:c01::feed:1  1.078 ms
 4  2001:630:302:705::feed:1  5.965 ms
 5  2001:630:0:8045::601  3.151 ms
 6  2001:630:0:10::3e  6.342 ms
 7  2001:630:0:10::9a  6.570 ms
 8  2001:668:0:3::4000:401  6.788 ms
 9  2001:668:0:2::1:861  6.563 ms
10  2001:668:0:2::1:1c31  12.222 ms
11  2001:668:0:2::1:19f2  12.356 ms
12  2001:668:0:3::6000:102  17.406 ms
13  2001:888:0:1152::1  17.218 ms
14  2001:888:0:3::42  18.772 ms
15  2001:888:12b4::a604:3001  29.074 ms
traceroute to 2001:1ba0:2a0:5965:0:30:32:1 (2001:1ba0:2a0:5965:0:30:32:1), 30 hops max, 80 byte packets
 1  2001:630:301:1100::2  0.677 ms
 2  2001:630:301:7005::1  0.811 ms
 3  2001:630:302:c01::feed:1  0.825 ms
 4  2001:630:302:705::feed:1  1.464 ms
 5  2001:630:0:8045::601  2.984 ms
 6  2001:630:0:10::3e  6.222 ms
 7  2001:630:0:10::9a  6.604 ms
 8  2001:630:0:10::152  6.615 ms
 9  2001:7f8:4::7218:1  34.889 ms
10  2001:4de8:d1a1:1111:4::1  34.891 ms
11  2001:4de8:d1a1:1111:1f::2  34.848 ms
12  2001:4de8:d1a1:1111:11::2  40.155 ms
13  2001:1ba0:babe::1:2  40.309 ms
14  2001:1ba0:2a0:5965:0:30:32:1  40.154 ms

I need to sort the IP address in front of "traceroute to" and the last one on route trace.
Please i want them to look like;
Code:
2001:1ba0:2a0:5965:0:30:24:1 destination is 2001:1ba0:2a0:5965:0:30:24:1
2001:8a8:21:5:216:3eff:fec1:423 destination is 2001:8a8:21:5:216:3eff:fec1:423
.........and like that for the rest

Bear in mind please that the list is so long. thanks
 

10 More Discussions You Might Find Interesting

1. Programming

Sorting in C++..

Hi, I need to do a sorting of 2 arrays. One array contains the values of both integer and character and other array can be anything. For example: Array={'1L','2C','NULL','23L','11L','4C','10L','9C'} Array= {'01-02-13-1x','02-11-23-3s','00-12-13-5f','NULL','22k',} If any of these arrays... (6 Replies)
Discussion started by: ronix007
6 Replies

2. Shell Programming and Scripting

Need immediate help with sorting!!!

hey, I have a file that looks smthng like this: /*--- abcd_0050 ---*/ asdfjk adsfkja lkjljgafsd /*---abcd_0005 ---*/ lkjkljbfkgj ldfksjgf dfkgfjb /*-- abcd_0055--*/ klhfdghd dflkjgd jfdg I would like it to be sorted so that it looks like this: /*---abcd_0005 ---*/ lkjkljbfkgj (9 Replies)
Discussion started by: sasuke_uchiha
9 Replies

3. Shell Programming and Scripting

Regarding sorting

I have the following file. Its an output from a du command with certain conditions attached to it. I used du -ah as I need the 1st column to look human readable. sort -nr is not giving me the output I need, nor is sort -dr. Please help out. cat testout 121K ./OMautomation/pvd 14M ... (6 Replies)
Discussion started by: vivek.bharadwaj
6 Replies

4. UNIX for Dummies Questions & Answers

HELP on sorting

hi everyone, I am kind of new to this forum. I need help in sorting this data out accordingly, I am actually doing a traceroute application and wants my AS path displayed in front of my address like this; 192.168.1.1 AS28513 AS65534 AS5089 AS5089 .... till the last AS number and if possible... (1 Reply)
Discussion started by: sam127
1 Replies

5. UNIX for Advanced & Expert Users

HELP on sorting

hi everyone, I am kind of new to this forum. I need help in sorting this data out accordingly, I am actually doing a traceroute application and wants my AS path displayed in front of my address like this; 192.168.1.1 AS28513 AS65534 AS5089 AS5089 .... till the last AS number and if possible... (1 Reply)
Discussion started by: sam127
1 Replies

6. Shell Programming and Scripting

sorting

Hi all, Does anyone can help me the following question? I would like to write an AWK script. In the following input file, each number in "start" is paired with numbers in column "end". No Start End A 22,222,33,22,1233,3232,44 555,333,222,55,1235,3235,66... (7 Replies)
Discussion started by: phoeberunner
7 Replies

7. UNIX for Dummies Questions & Answers

Help Needed with Sorting Output

Hi all, I'm using Solaris 10, and need help in sorting the below output from the syslog file in descending rather than ascending order. I would like both the hostname and message columns to be sorted, but right now only the message is sorted and the count column, whose order I would like... (2 Replies)
Discussion started by: wthomas
2 Replies

8. UNIX for Dummies Questions & Answers

Help needed sorting syslog columns

Hi all, I need your help in sorting some columns in a syslog report. The command is: for messages in `cat syslog_message_list.txt`; do grep $messages syslog.`date +%d%m%y`.log | \ tr -s " " | cut -d" " -f4,9- | sort| uniq -c >> syslog.`date +%d%m%y`.report; done The output is: 1... (4 Replies)
Discussion started by: wthomas
4 Replies

9. Red Hat

Sorting

Hi guys, i have a prblm in unix scripting can anyone of you figure it out for me?? The question is i need to store the parent processid and processid in a file and using shell scripting, if i enter the parent processid it should display the processid. one more... (5 Replies)
Discussion started by: rajeshb6
5 Replies

10. Shell Programming and Scripting

Help needed in sorting

I have a file which contains following lines: 0114714710147 09013 00025.00D986532147 2814714710147 09013 00045.00D985532147 Now, I need to sort the file with above bold and colured one. Means: first sorting will be done by: 147147 then by 10147 09013 after that by 986532147. The... (2 Replies)
Discussion started by: George1234
2 Replies
All times are GMT -4. The time now is 06:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy