Sponsored Content
Top Forums Shell Programming and Scripting Script to unorder an ordered list Post 302224876 by kerpm on Thursday 14th of August 2008 06:26:05 AM
Old 08-14-2008
Script to unorder an ordered list

Wondering if someone could help me with this in any scripting/programming language. I have a list of ordered IP addresses and I want to unorder them. So for example, if I had a file like this:

111.111.111.110
111.111.111.111
111.111.111.112
111.111.111.113
111.111.111.114

I would want to make it so that is unordered. It does not matter the outcome as long as they are not in ascending/descending order. So something like the following would be acceptable:

111.111.111.112
111.111.111.110
111.111.111.114
111.111.111.113
111.111.111.111

I would need to do this on very large lists of IP addresses such as 500. Any help would be very much appreciated.
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

merging two file in an ordered way

actually, it seems somewhat confusing.. let me clearify it i want a file having all the attributes produced by ls -lc command. i want to add one more thing i.e. time of last access to a file attribute. so how can i merge these two things in a single file in a columnar way. i tried with these... (2 Replies)
Discussion started by: raku05
2 Replies

2. Shell Programming and Scripting

Print is not in ordered after hash converted to array

Perl: Can anyone tell me why after I convert the hash into an array, when I print it out, it's not in the order like the hash? See below.. my %cityZip = ("Logan, AL", 35098, "Los Angeles, CA", 90001, "OrangeVille, IL", 61060, "Palm Bay, FL",... (6 Replies)
Discussion started by: teiji
6 Replies

3. Shell Programming and Scripting

Merge 3 files in 1 file in an ordered way

Hi, I have a question that I cannot solve. if I have a file like this (lets say "x-values.dat"): x1 x2 x3 another file like this (lets say "y-values.dat"): y1 y2 y3 y4 and another file like this (lets say "p-values.dat"): p1 p2 p3 ... p12 How can I get this output? x1 y1 p1 x1 y2... (16 Replies)
Discussion started by: lego
16 Replies

4. UNIX for Advanced & Expert Users

verify ordered records

I need to resolve next problem, I have a unix txt file, I need to verify that it is to ordered for a key , in this case CUSTOMER, I need to do it with awk , it is shows an example Incorrect Correct CUSTOMER PRODUCT CUSTOMER PRODUCT 1 |01 1 ... (7 Replies)
Discussion started by: bsobarzoa
7 Replies

5. What is on Your Mind?

I just ordered a Mini-Box with no fan!

I just ordered a Mini-Box M350 with a Mini-ITX Intel DM510MO motherboard. NO FAN! I've come to hate the wine of spinning mechanisms in PCs in my quiet home. This one is for surfing the web in my living room (instead of using this laptop), so it doesn't really need much power. If I do... (1 Reply)
Discussion started by: KenJackson
1 Replies

6. UNIX for Dummies Questions & Answers

make ls retrive ordered list of elements

Hello friends!! I have a question regarding the use of ls in unix. I have a folder with files: t1.txt t2.txt t3.txt t4.txt ... t10.txt When I make an ls I always get: t10.txt t1.txt t2.txt t3.txt .. t9.txt (2 Replies)
Discussion started by: SaktiPhoenix
2 Replies

7. Shell Programming and Scripting

Grep only specific lines ordered by column/date

Hi everybody, I'd like to think I've been through the search tool not only on this site, but also on google too, but I haven't been able to find what I was looking for. If I might've missed something on this forum, please slap me in the face with a link that you consider useful for my query :D ... (4 Replies)
Discussion started by: dilibau
4 Replies

8. Shell Programming and Scripting

Find common values in python list in ordered format

Hello All, There are various codes available to find the intersection between two sets in python. But my case is the following: I want to find the continual common pattern in different lists compared to list1. (i have underlined the longest common patterns in set a and set b) a = 2, 3, 5,... (1 Reply)
Discussion started by: Zam_1234
1 Replies
CUBRID_SEQ_PUT(3)							 1							 CUBRID_SEQ_PUT(3)

cubrid_seq_put - Update the element value of sequence type column using OID

SYNOPSIS
bool cubrid_seq_put (resource $conn_identifier, string $oid, string $attr_name, int $index, string $seq_element) DESCRIPTION
The cubrid_seq_put(3) function is used to update the content of the requested element in a sequent type attribute using OID. PARAMETERS
o $conn_identifier -Connection identifier. o $oid -OID of the instance you want to work with. o $attr_name -Name of the attribute that you want to update an element. o $index -Index (1-based) of the element that you want to update. o $seq_element -New content that you want to use for the update. RETURN VALUES
TRUE, when process is successful. FALSE, when process is unsuccessful. EXAMPLES
Example #1 cubrid_seq_put(3) example <?php $conn = cubrid_connect("localhost", 33000, "demodb", "dba"); @cubrid_execute($conn, "DROP TABLE foo"); cubrid_execute($conn, "CREATE TABLE foo(a int AUTO_INCREMENT, b set(int), c sequence(int), d char(10))"); cubrid_execute($conn, "INSERT INTO foo(a, b, c, d) VALUES(1, {1,2,3}, {11,22,33,333}, 'a')"); $req = cubrid_execute($conn, "SELECT * FROM foo", CUBRID_INCLUDE_OID); cubrid_move_cursor($req, 1, CUBRID_CURSOR_FIRST); $oid = cubrid_current_oid($req); $attr = cubrid_col_get($conn, $oid, "c"); var_dump($attr); cubrid_seq_put($conn, $oid, "c", 1, "111"); $attr = cubrid_col_get($conn, $oid, "c"); var_dump($attr); cubrid_close_request($req); cubrid_disconnect($conn); ?> The above example will output: array(4) { [0]=> string(2) "11" [1]=> string(2) "22" [2]=> string(2) "33" [3]=> string(3) "333" } array(4) { [0]=> string(3) "111" [1]=> string(2) "22" [2]=> string(2) "33" [3]=> string(3) "333" } SEE ALSO
cubrid_seq_drop(3), cubrid_seq_insert(3). PHP Documentation Group CUBRID_SEQ_PUT(3)
All times are GMT -4. The time now is 09:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy