Hi,
I'am working under unix solaris
I have a text file with set of lines, each set of lines (BLOCK) have
three fixed lines :
Quote:
FIRSTxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
SECNDxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
THEND
Between SECND line and THEND we have N lines, N differ from a block to another
Quote:
FIRSTxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
SECNDxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
LINE1xxxxx
LINE2xxxxxxxxxxxxxxx
...
LINENxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
THEND
FIRSTxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
SECNDxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
LINE1xxxxx
LINE2xxxxxxxxxxxxxxx
...
LINENxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
THEND
FIRSTxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
SECNDxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
LINE1xxxxx
LINE2xxxxxxxxxxxxxxx
...
LINENxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
THEND
.
.
.
sample :
Quote:
FIRST0873HGGD EE 889
SECNDKIIKIE 99099 88 7 DDSFF 000999999
7888DUBN998FFFFFFFFFF
9999FFDD 88 RFR 88888 0000R YJ
THEND
FIRST0873HGGD EE 889
SECNDKIIKIE 99099 88 7 DDSFF 000999999
7333DUBN998FFFFFFFFFF
7333DUBN998FFFFFFFFFF
7333DUBN998FFFFFFFFFF
5688DUBN998FFFFFFFFFF
9999FFDD 88 RFR 88888 0000R YJ
THEND
FIRST0873HGGD EE 889
SECNDKIIKIE 99099 88 7 DDSFF 000677999
4444DUBN998FFFFUUUF
9999FFDD 88 RFR 88888 0000R YJ
THEND
FIRST0873HGGD EE 889
SECNDKIIKIE 99099 88 7 DDJHF 004444999
7888DUBN998FSSSFFFF
7654DUBN998FSSSFFFF
9999FFDD 88 RFR 88888 0000R YJ
THEND
i have to make a script wich delete each 3 fixed lines if N=0 (no lines between SECND end THEND line) :
delete every set of this three sucessive lines (FIRST SECND THEND)
FIRST0873HGGD EE 889
SECNDKIIKIE 99099 88 7 DDSFF 000999999
THEND
sample :
before the script i have this text file
Quote:
FIRST0873HGGD EE 889
SECNDKIIKIE 99099 88 7 DDSFF 000999999
7888DUBN998FFFFFFFFFF
6666FFDD 88 RFR 88888 0000R YJ
THEND
FIRST0873HGGD EE 889
SECNDKIIKIE 99099 88 7 DDJHF 004444999
THEND
FIRST0873HGGD EE 889
SECNDKIIKIE 99099 88 7 DDSFF 000999999
7333DUBN998FFFFFFFFFF
5688DUBN998FFFFFFFFFF
7777FFDD 88 RFR 88888 0000R YJ
THEND
FIRST0873HGGD EE 889
SECNDKIIKIE 99099 88 7 DDSFF 000677999
4444DUBN998FFFFUUUF
7777FFDD 88 RFR 88888 0000R YJ
THEND
FIRST0873HGGD EE 889
SECNDKIIKIE 99099 88 7 DDJHF 004444999
THEND
after the script i will have :
Quote:
FIRST0873HGGD EE 889
SECNDKIIKIE 99099 88 7 DDSFF 000999999
7888DUBN998FFFFFFFFFF
6666FFDD 88 RFR 88888 0000R YJ
THEND
FIRST0873HGGD EE 889
SECNDKIIKIE 99099 88 7 DDSFF 000999999
7333DUBN998FFFFFFFFFF
5688DUBN998FFFFFFFFFF
7777FFDD 88 RFR 88888 0000R YJ
THEND
FIRST0873HGGD EE 889
SECNDKIIKIE 99099 88 7 DDSFF 000677999
4444DUBN998FFFFUUUF
7777FFDD 88 RFR 88888 0000R YJ
THEND
thanks a lot for your help