473,395 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Sorting of an array

Chittaranjan
Hi All,

I want to sort an array which is having data like below:

@array = {1 aaa bbb ccc 4 sss ddd fff};

In this array above I have two arrays that one is from 1 to ccc and another is from 4 to fff. I want to sort in such a way which will out put me like:

@array = {1 aaa bbb ccc 2 sss ddd fff};

If any kind of solutions are there then please suggest me I am seeking for this soon. If possible then please post some sample codes.

Thanks and Regards,
Chittaranjan.
Apr 2 '07 #1
5 1254
miller
1,089 Expert 1GB
Hi Chittaranjan,

What have you tried so far?

- Miller
Apr 2 '07 #2
KevinADC
4,059 Expert 2GB
the array is already sorted, so the question makes no sense. Plus it is not two arrays, it is just one array. Explain your situation better and post the code you have been trying. Is this school work? That array looks contrived.
Apr 2 '07 #3
the array is already sorted, so the question makes no sense. Plus it is not two arrays, it is just one array. Explain your situation better and post the code you have been trying. Is this school work? That array looks contrived.
Thanks for your quick response but this is not a school work I just wanted to say that I have an array which is a combination of two different arrays let me explain the entire situation:
I have one tab separated array $tData[$i] = {1 name description number etc}
and one more that is $tAddr[$j] = {xyz address city etc}
I am joining these two arrays like $tline[$i] = $tData[$i] . $delim . $tAddr[$j];

My arrays I have shown above are containing multiple similar values as shown above so after joining I am getting the resulting array as
$tline[$i] = {1 name description number etc xyz address city etc} as you can see I have on $i that increments upto some length I have given.

So my question is that If I will get an array like
$tline[$i] = {1 name description number etc xyz address city etc 4 name description number etc xyz address city etc}
Here I want to sort the numbers in bold tha should look like
$tline[$i] = {1 name description number etc xyz address city etc 2 name description number etc xyz address city etc}

Hope this will help me to get some help from experts like you...

Thanks again,
Chittaranjan.
Apr 3 '07 #4
However Thanks a lot to you all for a great help in a great manner I am able to figure out my solution.

Thanks,
Chittaranjan :)
Apr 3 '07 #5
KevinADC
4,059 Expert 2GB
Consider we offered you no real help, it's nice of you to thank us.
Apr 3 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Paul Kirby | last post by:
Hello All I am trying to update me code to use arrays to store a group of information and I have come up with a problem sorting the multiple array :( Array trying to sort: (7 arrays put into...
7
by: Federico G. Babelis | last post by:
Hi All: I have this line of code, but the syntax check in VB.NET 2003 and also in VB.NET 2005 Beta 2 shows as unknown: Dim local4 As Byte Fixed(local4 = AddressOf dest(offset)) ...
3
by: SilverWolf | last post by:
I need some help with sorting and shuffling array of strings. I can't seem to get qsort working, and I don't even know how to start to shuffle the array. Here is what I have for now: #include...
7
by: Foodbank | last post by:
Hi everyone. I'm having trouble with this radix sorting program. I've gotten some of it coded except for the actual sorting :( The book I'm teaching myself with (Data Structures Using C and...
0
by: Brian Henry | last post by:
Here is another virtual mode example for the .NET 2.0 framework while working with the list view. Since you can not access the items collection of the list view you need to do sorting another...
7
by: Kamal | last post by:
Hello all, I have a very simple html table with collapsible rows and sorting capabilities. The collapsible row is hidden with css rule (display:none). When one clicks in the left of the...
5
KevinADC
by: KevinADC | last post by:
Introduction This discussion of the sort function is targeted at beginners to perl coding. More experienced perl coders will find nothing new or useful. Sorting lists or arrays is a very common...
1
KevinADC
by: KevinADC | last post by:
Introduction In part one we discussed the default sort function. In part two we will discuss more advanced techniques you can use to sort data. Some of the techniques might introduce unfamiliar...
5
by: lemlimlee | last post by:
hello, this is the task i need to do: For this task, you are to develop a Java program that allows a user to search or sort an array of numbers using an algorithm that the user chooses. The...
5
by: jrod11 | last post by:
hi, I found a jquery html table sorting code i have implemented. I am trying to figure out how to edit how many colums there are, but every time i remove code that I think controls how many colums...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.