looking for some solutions? You are welcome.

SOLVED: If the row underneath the previous row equals the first column's specific value, print the two rows

TempoChocolate:

I have a variable input file which could be formatted as below.

text1 valueA valueN valueB
text2 valueX
text1 valueC valueN valueD
text2 valueX
text1 valueE valueM valueF
text1 valueG valueM valueH
text1 valueI valueN valueJ
text2 valueX
text1 valueK valueO valueL
text1 valueP valueO valueQ
text1 valueR valueN valueS
text1 valueT valueM valueU

I only want to print text1 valueA valueN valueB if text2 valueX exists underneath the previous row. For example, the output should be:

text1 valueA valueN valueB
text2 valueX
text1 valueC valueN valueD
text2 valueX
text1 valueI valueN valueJ
text2 valueX



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
Share:

No comments:

Recent