bash regex - sort
Here is a sample of a file.
File is divided into a section called: case "some_number" As you can see numbers are set randomly. What I need to achive is to sort all case sections beginning from the lowest to highest, so case "4" is 1st; case "111" is 2nd and case "309" is 3rd. The problem is that content of each case sections must be kept. Is this possible ? Code:
case "309": ### - asdasdscxczx |
Not a bash solution, but that is the wrong hammer for this kind of nail.
Code:
#! /usr/bin/perl -w --- rod. |
Well... I must say I like that hammer :)
Many thanks. |
The OP has a good answer, but I was thinking about this post on the subway ride home before I saw the answer. So in the spirit of TIMTOWTDI, here's my variant on it:
Code:
#!/usr/bin/env perl |
All times are GMT -5. The time now is 10:14 PM. |