Sponsored Content
Full Discussion: Sorting blocks of data
Top Forums Shell Programming and Scripting Sorting blocks of data Post 302125028 by alfredo123 on Tuesday 3rd of July 2007 12:04:38 PM
Old 07-03-2007
Error Sorting blocks of data

Hello all,

Below is what I am trying to accomplish:

I have a file that looks like this

Code:
/* ----------------- xxxx.y_abcd_00000050 ----------------- */ 

jdghjghkla
sadgsdags
asdgsdgasd
asdgsagasdg

/* ----------------- xxxx.y_abcd_00000055 ----------------- */ 

sdgsdg
sdgxcvzxcbv
rtertwre
tqwetqe
xzcbvzxcb

/* ----------------- xxxx.y_abcd_00000005 ----------------- */ 

sdgsdg
sdgxcvzxcbv
rtertwre
tqwetqe
xzcbvzxcb

I need to sort it so that it looks like this

Code:
/* ----------------- xxxx.y_abcd_00000005 ----------------- */ 

sdgsdg
sdgxcvzxcbv
rtertwre
tqwetqe
xzcbvzxcb

/* ----------------- xxxx.y_abcd_00000050 ----------------- */ 

jdghjghkla
sadgsdags
asdgsdgasd
asdgsagasdg

/* ----------------- xxxx.y_abcd_00000055 ----------------- */ 

sdgsdg
sdgxcvzxcbv
rtertwre
tqwetqe
xzcbvzxcb

So i really want to sort only based on the items within /*----*/

I looked up the forums but could not find anything....any suggestions?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Delete blocks with no data..

Hi, I tried this but could not get it... here is what I need I have an xml where I get all the data in blocks but some times I get empty blocks with no data...shown below..I need to delete only those blocks with no data, I tried couple of ways but could not do it..any help is appreciated...... (1 Reply)
Discussion started by: mgirinath
1 Replies

2. UNIX for Dummies Questions & Answers

Sorting data from a to z

Hi, Let's say I have these 3 columns; NGC1234 6 9 SL899 4 1 NGC1075 8 3 SL709 5 2 And I want to sort the data according to the first column (from a to z) like having them as: NGC1075 8 3 NGC1234 6 9 SL709 5 2 SL899 4 1 Can that be done... (2 Replies)
Discussion started by: cosmologist
2 Replies

3. UNIX for Dummies Questions & Answers

Sorting data

Hello guys. I need help figuring this one out. It's probably really easy. Thanks in advance! I have a file say for example containing this: Rice Food Carrots Food Beans Food Plates Kitchen Fork Kitchen Knives Kitchen I need: Food Rice, Carrots, Beans Kitchen Plates, Fork,... (7 Replies)
Discussion started by: visuelz
7 Replies

4. UNIX for Dummies Questions & Answers

Convert 512-blocks to 4k blocks

I'm Unix. I'm looking at "df" on Unix now and below is an example. It's lists the filesystems out in 512-blocks, I need this in 4k blocks. Is there a way to do this in Unix or do I manually convert and how? So for container 1 there is 7,340,032 in size in 512-blocks. What would the 4k block be... (2 Replies)
Discussion started by: rockycj
2 Replies

5. Shell Programming and Scripting

how to split this file into blocks and then send these blocks as input to the tool called Yices?

Hello, I have a file like this: FILE.TXT: (define argc :: int) (assert ( > argc 1)) (assert ( = argc 1)) <check> # (define c :: float) (assert ( > c 0)) (assert ( = c 0)) <check> # now, i want to separate each block('#' is the delimeter), make them separate files, and then send them as... (5 Replies)
Discussion started by: paramad
5 Replies

6. Shell Programming and Scripting

Extracting data blocks from file

Hi all, I want to extract blocks of data from a file depending on the contents of that block. The input file(table) has several blocks each starting with 'gene' in the first column. I want to extract only those blocks which do not have the expression '_T02' in the second column. Input file ... (3 Replies)
Discussion started by: newbie83
3 Replies

7. Shell Programming and Scripting

Difficult transposing of data from profiles blocks

Hello to all, I really hope some expert or awk guru could help me with this. I don't have how to begin and hope is not so difficult for somebody. I'll expecting how someone could resolve this problem I have to parse this. I have blocks of parameters for each MSISDN and I would like to extract... (9 Replies)
Discussion started by: Ophiuchus
9 Replies

8. Shell Programming and Scripting

Row blocks to column blocks

Hello, Searched for a while and found some "line-to-column" script. My case is similar but with multiple fields each row: S02 Length Per S02 7043 3.864 S02 54477 29.89 S02 104841 57.52 S03 Length Per S03 1150 0.835 S03 1321 0.96 S03 ... (9 Replies)
Discussion started by: yifangt
9 Replies

9. UNIX for Dummies Questions & Answers

Delete data blocks based on missing combinations

Hello masters, I am filtering data based on completeness. A (Name , Group) combination in File2 is only complete when it has data for all subgroups specified in File1. All incomplete (Name , Group) combinations do not appear in the output. So for example , Name1 Group 1 in File2 is... (6 Replies)
Discussion started by: senhia83
6 Replies

10. UNIX for Beginners Questions & Answers

Sorting blocks by a section of the identifier

I have a file that should be sorted by a string (shown in red in my example below) in the identifier. The RS is ^@M0, something like this: @M04961:22:000000000-B5VGJ:1:1101:9280:7106 1:N:0:86 GGCATGAAAACATACAAACCGTCTTTCCAGAAATTGTTCCAAGTATCGGCAACAGCTTTATCAATACCATGAAAAATATCAACCACACCAGAAGCAGCAT... (16 Replies)
Discussion started by: Xterra
16 Replies
UNICODE_START(1)					      General Commands Manual						  UNICODE_START(1)

NAME
unicode_start - put keyboard and console in unicode mode SYNOPSIS
unicode_start [font [umap]] DESCRIPTION
The unicode_start command will put the keyboard and console into Unicode (UTF-8) mode. For the keyboard this means that one can attach 16-bit U+xxxx values to keyboard keys using loadkeys(1), and have these appear as UTF-8 input to user programs. Also, that one can type hexadecimal Alt-xxxx using the numeric keypad, and again produce UTF-8. For the console this means that the kernel expects UTF-8 output from user programs, and displays the output accordingly. The parameter font is a font that is loaded. It should have a built-in Unicode map, or, if it hasn't, such a map can be given explicitly as second parameter. When no font was specified, the current font is kept. NOTE
Unicode mode is a parameter with a value per virtual console. However, usually the font and keymap is common to all consoles. SEE ALSO
dumpkeys(1), kbd_mode(1), loadkeys(1), unicode_stop(1), utf-8(7), setfont(8) 3 Feb 2001 UNICODE_START(1)
All times are GMT -4. The time now is 11:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy