Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I have a sample file
First line 11111 anything
second line anything
third line anything
fourth line 2222 anything
fifth line anything
sixth line anything
seventh line 3333 anything
eightth line anything
ninth line 1111 anything
tenth line anything
eleventh line anything
twelfth line 3333 anything
thirtienth line anything
fourteenth line anythingoutput wanted
First line 11111 anything
second line anything
third line anything
eleventh line anything
fourth line 2222 anything
fifth line anything
sixth line anything
seventh line 3333 anything
eightth line anything
fourteenth line anythingI need to remove lines based on ####, keeping first instance line with #### along with the lines directly below until I reach the next line with ####. However, subsequent instance(s) of same #### should only include lines that are NOT the line with #### and NOT the line directly below, but any other lines after the #### line and before the next line with ####.
This needs to work in different OS batch files

i really couldn't get what you are saying. describe again, but this time don't use #### , use an actual number from your sample file. and don't write long winded english. Use examples of lines from your sample file to explain clearly.

"This needs to work in different OS batch files"
Which ones?
=====================================
If at first you don't succeed, you're about average.M2

I want to use this for both XP and Vista and on a Windows 2003 server.
I cannot give sample file for certain reasons, but here is part of it:
Input:
H,1,,220523,20090616,,,,
D,2,1,,,,,,,220523,PART,,,,
S,3,2,,,,,00012345,,,
SD,4,3,,,,,,,,,,,,,,,
H,1,,186284,20090616,,,,
D,2,1,,,,,,,186284,PART2,,,,
S,3,2,,,,,0006789,,,
SD,4,3,,,,,,,,,,,,,,,
H,1,,186677,20090616,,,,
D,2,1,,,,,,,186677,PART3,,,,
S,3,2,,,,,000121314,,,
SD,4,3,,,,,,,,,,,,,,,
H,1,,186284,20090616,,,,
D,2,1,,,,,,,186284,PART2,,,,
S,3,2,,,,,000678910,,,
SD,4,3,,,,,,,,,,,,,,,
H,1,,186677,20090616,,,,
D,2,1,,,,,,,186677,PART3,,,,
S,3,2,,,,,00012131415,,,
SD,4,3,,,,,,,,,,,,,,,Hoping for Output:
H,1,,220523,20090616,,,,
D,2,1,,,,,,,220523,PART,,,,
S,3,2,,,,,00012345,,,
SD,4,3,,,,,,,,,,,,,,,
H,1,,186284,20090616,,,,
D,2,1,,,,,,,186284,PART2,,,,
S,3,2,,,,,0006789,,,
SD,4,3,,,,,,,,,,,,,,,
S,3,2,,,,,000678910,,,
SD,4,3,,,,,,,,,,,,,,,
H,1,,186677,20090616,,,,
D,2,1,,,,,,,186677,PART3,,,,
S,3,2,,,,,000121314,,,
SD,4,3,,,,,,,,,,,,,,,
S,3,2,,,,,00012131415,,,
SD,4,3,,,,,,,,,,,,,,,

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |