Sponsored Content
Full Discussion: how to delete lines
Top Forums Shell Programming and Scripting how to delete lines Post 302273138 by mrpranab on Friday 2nd of January 2009 08:21:22 PM
Old 01-02-2009
how to delete lines

Hi All,

I have a file called test.flg.fl and the data contains in the file as below

mmddyy_list20.prn
mmddyy_list21.prn
mmddyy_list22.prn
mmddyy_list23.prn
mmddyy_list24.prn
mmddyy_list25.prn
mmddyy_list26.prn
mmddyy_list27.prn
mmddyy_list28.prn
mmddyy_list29.prn
mmddyy_list3.prn
mmddyy_list30.prn
mmddyy_list31.prn
mmddyy_list32.prn
mmddyy_list33.prn
mmddyy_list34.prn
mmddyy_list35.prn
mmddyy_list36.prn
mmddyy_list37.prn
mmddyy_list38.prn
mmddyy_list42.prn

I need to delete lines which contain list21 to list 37 (i.e. list21, list22, list23 etc etc..). So my new file test.flg.fl will be now looks like below after I delete the lines.

mmddyy_list20.prn
mmddyy_list3.prn
mmddyy_list38.prn
mmddyy_list42.prn

Can you please tell me the command how to do this to delete those lines using Unix shell scripts? Please let me know if you need more informations.

Thank you!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to delete first 5 lines and last five lines in all text files

Hi I want to delete first five and last five lines in text files without opening the file and also i want to keep the same file name for all the files. Thanks in advance!!! Ragav (10 Replies)
Discussion started by: ragavendran31
10 Replies

2. Shell Programming and Scripting

Grep and delete lines except the lines with strings

Hi I am writing a script which should read a file and search for certain strings 'approved' or 'removed' and retain only those lines that contain the above strings. Ex: file name 'test' test: approved package waiting for approval package disapproved package removed package approved... (14 Replies)
Discussion started by: vj8436
14 Replies

3. Shell Programming and Scripting

How to delete lines in a file that have duplicates or derive the lines that aper once

Input: a b b c d d I need: a c I know how to get this (the lines that have duplicates) : b d sort file | uniq -d But i need opossite of this. I have searched the forum and other places as well, but have found solution for everything except this variant of the problem. (3 Replies)
Discussion started by: necroman08
3 Replies

4. Shell Programming and Scripting

sed problem - delete all lines until a match on 2 lines

First of all, I know this can be more eassily done with perl or other scripting languages but, that's not the issue. I need this in sed. (or wander if it's possible ) I got a file (trace file to recreate the control file from oracle for the dba boys) which contains some lines another line... (11 Replies)
Discussion started by: plelie2
11 Replies

5. UNIX for Dummies Questions & Answers

How get only required lines & delete the rest of the lines in file

Hiiii I have a file which contains huge data as a.dat: PDE 1990 1 9 18 51 28.90 24.7500 95.2800 118.0 6.1 0.0 BURMA event name: 010990D time shift: 7.3000 half duration: 5.0000 latitude: 24.4200 longitude: 94.9500 depth: 129.6000 Mrr: ... (7 Replies)
Discussion started by: reva
7 Replies

6. Shell Programming and Scripting

need to delete all lines from a group of files except the 1st 2 lines

Hello, I have a group of text files with many lines in each file. I need to delete all the lines in each and only leave 2 lines in each file. (3 Replies)
Discussion started by: script_op2a
3 Replies

7. UNIX for Advanced & Expert Users

In a huge file, Delete duplicate lines leaving unique lines

Hi All, I have a very huge file (4GB) which has duplicate lines. I want to delete duplicate lines leaving unique lines. Sort, uniq, awk '!x++' are not working as its running out of buffer space. I dont know if this works : I want to read each line of the File in a For Loop, and want to... (16 Replies)
Discussion started by: krishnix
16 Replies

8. Shell Programming and Scripting

search and replace, when found, delete multiple lines, add new set of lines?

hey guys, I tried searching but most 'search and replace' questions are related to one liners. Say I have a file to be replaced that has the following: $ cat testing.txt TESTING AAA BBB CCC DDD EEE FFF GGG HHH ENDTESTING This is the input file: (3 Replies)
Discussion started by: DeuceLee
3 Replies

9. Shell Programming and Scripting

Sed/awk to delete single lines that aren't touching other lines

Hello, I'm trying to figure out how to use sed or awk to delete single lines in a file. By single, I mean lines that are not touching any other lines (just one line with white space above and below). Example: one two three four five six seven eight I want it to look like: (6 Replies)
Discussion started by: slimjbe
6 Replies

10. UNIX for Beginners Questions & Answers

Delete multiple lines between blank lines containing two patterns

Hi all, I'm looking for a way (sed or awk) to delete multiple lines between blank lines containing two patterns ex: user: alpha parameter_1 = 15 parameter_2 = 1 parameter_3 = 0 user: alpha parameter_1 = 15 parameter_2 = 1 parameter_3 = 0 user: alpha parameter_1 = 16... (3 Replies)
Discussion started by: ce9888
3 Replies
gipddecode(1)						      General Commands Manual						     gipddecode(1)

NAME
gipddecode - Decode a GIPD stream into human readable form. SYNOPSIS
gipddecode [options] <gipd-file DESCRIPTION
gipddecode decodes a Granite Image Printer Driver (GIPD) stream into human readable form. Granite Systems was acquired by Monotype Imag- ing. A GIPD stream is the printer langauge used by the Lexmark X500 and the Dell 1125 MFP printers. COMMAND LINE OPTIONS
These are the options that can appear on the command line. -d basename Basename of .pbm file for saving decompressed planes. -h Print hex file offsets. -o Print file offsets. -D level Set Debug level [0]. EXAMPLES
Decode an GIPD stream file. $ gipddecode -h x500-mono.prn 0: OFST 0 len=128 80: OFST 1 len=128 100: OFST 2 len=128 180: OFST 3 len=128 200: OFST 4 len=128 [SNIP] 27d80: OFST 1275 len=128 27e00: 33%-12345X@PJL SET DISPINFOWHILEPRINT=OFF 27e2a: @PJL SET DISPATPAPERCHANG=OFF 27e49: @PJL SET JAMRECOVERY=ON 27e62: @PJL SET OUTPUTBLANKPAPER=OFF 27e81: @PJL SET PRINTSLOWLY=OFF 27e9b: @PJL SET REVERSEPRINT=OFF 27eb6: 33%-12345X 27ebf: GDIJ len=108 unk0=0, unk1=0, unk2=0, unk3=0, unk4=0 unk5=16777221(0x1000005), unk6=0, unk7=0, unk8=0, paper=0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27f37: GDIP len=52 nplane = 1, w254 = 4896, h254 = 6110 132018de, 0, 0, 0, 0, 1000000, 0, 0, 0, 0, 0, 0, 0, 27f77: GDIB 0 len=60(0x3c) 27fcb: GDIB 1 len=252(0xfc) 280df: GDIB 2 len=124(0x7c) 28173: GDIB 3 len=956(0x3bc) 28547: GDIB 4 len=1692(0x69c) 28bfb: GDIB 5 len=572(0x23c) 28e4f: GDIB 6 len=17084(0x42bc) 2d123: GDIB 7 len=18108(0x46bc) 317f7: GDIB 8 len=8508(0x213c) 3394b: GDIB 9 len=1756(0x6dc) 3403f: GDIB 10 len=1596(0x63c) 34693: GDIB 11 len=892(0x37c) 34a27: GDIB 12 len=2332(0x91c) 3535b: GDIB 13 len=8380(0x20bc) 3742f: GDIB 14 len=3452(0xd7c) 381c3: GDIB 15 len=60(0x3c) 38217: GDIB 16 len=1468(0x5bc) 387eb: GDIB 17 len=2076(0x81c) 3901f: GDIB 18 len=284(0x11c) 39153: GDIB 19 len=1660(0x67c) 397e7: GDIB 20 len=2908(0xb5c) 3a35b: GDIB 21 len=156(0x9c) 3a40f: GDIB 22 len=188(0xbc) 3a4e3: GDIB 23 len=220(0xdc) 3a5d7: GDIB 24 len=60(0x3c) 3a62b: PIDG 3a637: JIDG Total Size = 75843(0x12843) FILES
/usr/bin/gipddecode AUTHOR
Rick Richardson <rick.richardson@comcast.net>
All times are GMT -4. The time now is 07:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy