Sponsored Content
Top Forums Shell Programming and Scripting How to remove the lines with this pattern? Post 302995395 by nengcheng on Wednesday 5th of April 2017 11:12:58 AM
Old 04-05-2017
How to remove the lines with this pattern?

Hello everyone,
I have a sample data like this:
Code:
Glyma.10G051100 Glyma.02G036000 89.91 228 23 0 1 228 1 228 1e-78 294
Glyma.10G051100 Glyma.09G023700 87.28 228 29 0 1 228 1 228 1e-68 261
Glyma.10G285200 Glyma.20G103800 96.33 1663 55 4 1 1657 1 1663 0.0 2728
Glyma.10G285200 Glyma.05G093700 95.02 321 16 0 406 726 1 321 8e-142 505
Glyma.10G212900 Glyma.17G186600 90.36 1338 129 0 1 1338 1 1338 0.0 1757
Glyma.10G212900 Glyma.05G089000 90.21 1338 131 0 1 1338 1 1338 0.0 1746
Glyma.10G212900 Glyma.16G068000 88.67 1341 146 5 1 1338 1 1338 0.0 1629
Glyma.10G212900 Glyma.19G052400 88.83 1325 148 0 1 1325 1 1325 0.0 1628
Glyma.10G212900 Glyma.05G114900 88.25 1328 156 0 1 1328 1 1328 0.0 1589
Glyma.10G212900 Glyma.19G078900 89.31 262 27 1 1074 1335 202 462 2e-88 327
Glyma.10G212900 Glyma.19G078900 89.71 204 21 0 790 993 1 204 2e-68 261
Glyma.10G296300 Glyma.20G246900 95.11 470 23 0 1 470 1 470 0.0 741
Glyma.10G296300 Glyma.20G246900 92.26 168 7 2 744 911 834 995 2e-60 233
Glyma.10G001700 Glyma.10G179600 83.45 701 113 1 44 741 50 750 0.0 649
Glyma.10G179600 Glyma.10G001700 83.45 701 113 1 50 750 44 741 0.0 649
Glyma.10G056500 Glyma.10G056300 89.27 261 24 2 41 300 61 318 4e-88 324
Glyma.10G056300 Glyma.10G056500 89.27 261 24 2 61 318 41 300 5e-88 324
Glyma.10G088600 Glyma.10G085100 97.13 522 15 0 1 522 1 522 0.0 881
Glyma.10G085100 Glyma.10G088600 97.13 522 15 0 1 522 1 522 0.0 881

This is only small part of my dataset. What I expected is that remove all the
A-B, B-A pattern comparisons based on first two column:

Code:
Glyma.10G051100 Glyma.02G036000 89.91 228 23 0 1 228 1 228 1e-78 294
Glyma.10G051100 Glyma.09G023700 87.28 228 29 0 1 228 1 228 1e-68 261
Glyma.10G285200 Glyma.20G103800 96.33 1663 55 4 1 1657 1 1663 0.0 2728
Glyma.10G285200 Glyma.05G093700 95.02 321 16 0 406 726 1 321 8e-142 505
Glyma.10G212900 Glyma.17G186600 90.36 1338 129 0 1 1338 1 1338 0.0 1757
Glyma.10G212900 Glyma.05G089000 90.21 1338 131 0 1 1338 1 1338 0.0 1746
Glyma.10G212900 Glyma.16G068000 88.67 1341 146 5 1 1338 1 1338 0.0 1629
Glyma.10G212900 Glyma.19G052400 88.83 1325 148 0 1 1325 1 1325 0.0 1628
Glyma.10G212900 Glyma.05G114900 88.25 1328 156 0 1 1328 1 1328 0.0 1589
Glyma.10G212900 Glyma.19G078900 89.31 262 27 1 1074 1335 202 462 2e-88 327
Glyma.10G212900 Glyma.19G078900 89.71 204 21 0 790 993 1 204 2e-68 261
Glyma.10G296300 Glyma.20G246900 95.11 470 23 0 1 470 1 470 0.0 741
Glyma.10G296300 Glyma.20G246900 92.26 168 7 2 744 911 834 995 2e-60 233

How can I achieve this ? Thank you in advance.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep for a particular pattern and remove few lines above top and bottom of the patter

grep for a particular pattern and remove 5 lines above the pattern and 6 lines below the pattern root@server1 # cat filename Shell Programming and Scripting test1 Shell Programminsada asda dasd asd Shell Programming and Scripting Post New Thread Shell Programming and S sadsa ... (17 Replies)
Discussion started by: fed.linuxgossip
17 Replies

2. Shell Programming and Scripting

shell script to remove all lines from a file before a line starting with pattern

hi,, i hav a file with many lines.i need to remove all lines before a line begginning with a specific pattern from the file because these lines are not required. Can u help me out with either a perl script or shell script example:- if file initially contains lines: a b c d .1.2 d e f... (2 Replies)
Discussion started by: raksha.s
2 Replies

3. Shell Programming and Scripting

Remove lines from batch of files which match pattern

I need to remove all lines which does not match the pattern from a text file (batch of text files). I also need to keep the header line which is the first line of the file. Please can you provide an example for that. I used this to solve half of my work. I was unable to keep the first line of... (3 Replies)
Discussion started by: talktobog
3 Replies

4. Shell Programming and Scripting

NAWK to remove lines that matches a specific pattern

Hi, I have requirement that I need to split my input file into two files based on a search pattern "abc" For eg. my input file has below content abc defgh zyx I need file 1 with abc and file2 with defgh zyx I can use grep command to acheive this. But with grep I need... (8 Replies)
Discussion started by: sbhuvana20
8 Replies

5. Shell Programming and Scripting

Searching for pattern and remove the lines

Hi , I want to remove the specific pattern and remove those lines from file using shell script. i want to remove these lines <?xml version='1.0' encoding='UTF-8'?> <row_set> </row_set> my input file has content like this. file name: sample.xml <?xml version='1.0'... (4 Replies)
Discussion started by: nukala_2
4 Replies

6. Shell Programming and Scripting

Remove multiple lines that match pattern

Not sure how I can accomplish this. I would like to remove all interfaces that have the commands I would like to see: switchport port-security, spanning-tree portfast. One line is no problem. interface FastEthernet0/8 spanning-tree portfast interface FastEthernet0/9 spanning-tree... (4 Replies)
Discussion started by: mrlayance
4 Replies

7. Shell Programming and Scripting

awk remove/grab lines from file with pattern from other file

Sorry for the weird title but i have the following problem. We have several files which have between 10000 and about 500000 lines in them. From these files we want to remove lines which contain a pattern which is located in another file (around 20000 lines, all EAN codes). We also want to get... (28 Replies)
Discussion started by: SDohmen
28 Replies

8. Shell Programming and Scripting

sed to remove next 15 lines after pattern in Solaris

Team, I am trying to use sed to delete 15 lines, after pattern patch, which includes the pattern as well in Solaris. I used the below command, as we do it Linux, but it's not working as expected in Solaris. I am getting the error as "garbled".sed '/\/table/,+15d' status.html sed: command... (8 Replies)
Discussion started by: Nagaraj R
8 Replies

9. UNIX for Beginners Questions & Answers

awk to remove pattern and lines above pattern

In the awk below I am trying to remove all lines above and including the pattern Test or Test2. Each block is seperated by a newline and Test2 also appears in the lines to keep but it will always have additional text after it. The Test to remove will not. The awk executed until the || was added... (2 Replies)
Discussion started by: cmccabe
2 Replies

10. UNIX for Beginners Questions & Answers

awk with sed to combine lines and remove specific odd # pattern from line

In the awk piped to sed below I am trying to format file by removing the odd xxxx_digits and whitespace after, then move the even xxxx_digit to the line above it and add a space between them. There may be multiple lines in file but they are in the same format. The Filename_ID line is the last line... (4 Replies)
Discussion started by: cmccabe
4 Replies
KOI8-U(7)						     Linux Programmer's Manual							 KOI8-U(7)

NAME
koi8-u - Ukrainian character set encoded in octal, decimal, and hexadecimal DESCRIPTION
RFC 2310 defines an 8-bit character set, KOI8-U. KOI8-U encodes the characters used in Ukrainian and Byelorussian. KOI8-U characters The following table displays the characters in KOI8-U that are printable and unlisted in the ascii(7) manual page. Oct Dec Hex Char Description ----------------------------------------------------------------------- 200 128 80 BOX DRAWINGS LIGHT HORIZONTAL 201 129 81 | BOX DRAWINGS LIGHT VERTICAL 202 130 82 BOX DRAWINGS LIGHT DOWN AND RIGHT 203 131 83 BOX DRAWINGS LIGHT DOWN AND LEFT 204 132 84 BOX DRAWINGS LIGHT UP AND RIGHT 205 133 85 BOX DRAWINGS LIGHT UP AND LEFT 206 134 86 BOX DRAWINGS LIGHT VERTICAL AND RIGHT 207 135 87 BOX DRAWINGS LIGHT VERTICAL AND LEFT 210 136 88 BOX DRAWINGS LIGHT DOWN AND HORIZONTAL 211 137 89 BOX DRAWINGS LIGHT UP AND HORIZONTAL 212 138 8A BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL 213 139 8B UPPER HALF BLOCK 214 140 8C LOWER HALF BLOCK 215 141 8D FULL BLOCK 216 142 8E LEFT HALF BLOCK 217 143 8F RIGHT HALF BLOCK 220 144 90 LIGHT SHADE 221 145 91 MEDIUM SHADE 222 146 92 DARK SHADE 223 147 93 TOP HALF INTEGRAL 224 148 94 BLACK SQUARE 225 149 95 BULLET OPERATOR 226 150 96 / SQUARE ROOT 227 151 97 ~~ ALMOST EQUAL TO 230 152 98 <= LESS-THAN OR EQUAL TO 231 153 99 >= GREATER-THAN OR EQUAL TO 232 154 9A NO-BREAK SPACE 233 155 9B BOTTOM HALF INTEGRAL 234 156 9C o DEGREE SIGN 235 157 9D 2 SUPERSCRIPT TWO 236 158 9E . MIDDLE DOT 237 159 9F -:- DIVISION SIGN 240 160 A0 BOX DRAWINGS DOUBLE HORIZONTAL 241 161 A1 BOX DRAWINGS DOUBLE VERTICAL 242 162 A2 BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE 243 163 A3 CYRILLIC SMALL LETTER IO 244 164 A4 CYRILLIC SMALL LETTER UKRAINIAN IE 245 165 A5 BOX DRAWINGS DOUBLE DOWN AND RIGHT 246 166 A6 CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I 247 167 A7 CYRILLIC SMALL LETTER YI (Ukrainian) 250 168 A8 BOX DRAWINGS DOUBLE DOWN AND LEFT 251 169 A9 BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE 252 170 AA BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE 253 171 AB BOX DRAWINGS DOUBLE UP AND RIGHT 254 172 AC BOX DRAWINGS UP SINGLE AND LEFT DOUBLE 255 173 AD CYRILLIC SMALL LETTER GHE WITH UPTURN 256 174 AE BOX DRAWINGS DOUBLE UP AND LEFT 257 175 AF BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE 260 176 B0 BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE 261 177 B1 BOX DRAWINGS DOUBLE VERTICAL AND RIGHT 262 178 B2 BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE 263 179 B3 CYRILLIC CAPITAL LETTER IO 264 180 B4 CYRILLIC CAPITAL LETTER UKRAINIAN IE 265 181 B5 BOX DRAWINGS DOUBLE VERTICAL AND LEFT 266 182 B6 CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I 267 183 B7 CYRILLIC CAPITAL LETTER YI (Ukrainian) 270 184 B8 BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL 271 185 B9 BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE 272 186 BA BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE 273 187 BB BOX DRAWINGS DOUBLE UP AND HORIZONTAL 274 188 BC BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE 275 189 BD CYRILLIC CAPITAL LETTER GHE WITH UPTURN 276 190 BE BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL 277 191 BF (C) COPYRIGHT SIGN 300 192 C0 CYRILLIC SMALL LETTER YU 301 193 C1 CYRILLIC SMALL LETTER A 302 194 C2 CYRILLIC SMALL LETTER BE 303 195 C3 CYRILLIC SMALL LETTER TSE 304 196 C4 CYRILLIC SMALL LETTER DE 305 197 C5 CYRILLIC SMALL LETTER IE 306 198 C6 CYRILLIC SMALL LETTER EF 307 199 C7 CYRILLIC SMALL LETTER GHE 310 200 C8 CYRILLIC SMALL LETTER HA 311 201 C9 CYRILLIC SMALL LETTER I 312 202 CA CYRILLIC SMALL LETTER SHORT I 313 203 CB CYRILLIC SMALL LETTER KA 314 204 CC CYRILLIC SMALL LETTER EL 315 205 CD CYRILLIC SMALL LETTER EM 316 206 CE CYRILLIC SMALL LETTER EN 317 207 CF CYRILLIC SMALL LETTER O 320 208 D0 CYRILLIC SMALL LETTER PE 321 209 D1 CYRILLIC SMALL LETTER YA 322 210 D2 CYRILLIC SMALL LETTER ER 323 211 D3 CYRILLIC SMALL LETTER ES 324 212 D4 CYRILLIC SMALL LETTER TE 325 213 D5 CYRILLIC SMALL LETTER U 326 214 D6 CYRILLIC SMALL LETTER ZHE 327 215 D7 CYRILLIC SMALL LETTER VE 330 216 D8 CYRILLIC SMALL LETTER SOFT SIGN 331 217 D9 CYRILLIC SMALL LETTER YERU 332 218 DA CYRILLIC SMALL LETTER ZE 333 219 DB CYRILLIC SMALL LETTER SHA 334 220 DC CYRILLIC SMALL LETTER E 335 221 DD CYRILLIC SMALL LETTER SHCHA 336 222 DE CYRILLIC SMALL LETTER CHE 337 223 DF CYRILLIC SMALL LETTER HARD SIGN 340 224 E0 CYRILLIC CAPITAL LETTER YU 341 225 E1 CYRILLIC CAPITAL LETTER A 342 226 E2 CYRILLIC CAPITAL LETTER BE 343 227 E3 CYRILLIC CAPITAL LETTER TSE 344 228 E4 CYRILLIC CAPITAL LETTER DE 345 229 E5 CYRILLIC CAPITAL LETTER IE 346 230 E6 CYRILLIC CAPITAL LETTER EF 347 231 E7 CYRILLIC CAPITAL LETTER GHE 350 232 E8 CYRILLIC CAPITAL LETTER HA 351 233 E9 CYRILLIC CAPITAL LETTER I 352 234 EA CYRILLIC CAPITAL LETTER SHORT I 353 235 EB CYRILLIC CAPITAL LETTER KA 354 236 EC CYRILLIC CAPITAL LETTER EL 355 237 ED CYRILLIC CAPITAL LETTER EM 356 238 EE CYRILLIC CAPITAL LETTER EN 357 239 EF CYRILLIC CAPITAL LETTER O 360 240 F0 CYRILLIC CAPITAL LETTER PE 361 241 F1 CYRILLIC CAPITAL LETTER YA 362 242 F2 CYRILLIC CAPITAL LETTER ER 363 243 F3 CYRILLIC CAPITAL LETTER ES 364 244 F4 CYRILLIC CAPITAL LETTER TE 365 245 F5 CYRILLIC CAPITAL LETTER U 366 246 F6 CYRILLIC CAPITAL LETTER ZHE 367 247 F7 CYRILLIC CAPITAL LETTER VE 370 248 F8 CYRILLIC CAPITAL LETTER SOFT SIGN 371 249 F9 CYRILLIC CAPITAL LETTER YERU 372 250 FA CYRILLIC CAPITAL LETTER ZE 373 251 FB CYRILLIC CAPITAL LETTER SHA 374 252 FC CYRILLIC CAPITAL LETTER E 375 253 FD CYRILLIC CAPITAL LETTER SHCHA 376 254 FE CYRILLIC CAPITAL LETTER CHE 377 255 FF CYRILLIC CAPITAL LETTER HARD SIGN NOTES
The differences from KOI8-R are in the hex positions A4, A6, A7, AD, B4, B6, B7, and BD. SEE ALSO
ascii(7), charsets(7), cp1251(7), iso_8859-5(7), koi8-r(7), utf-8(7) COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. Linux 2016-07-17 KOI8-U(7)
All times are GMT -4. The time now is 12:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy