Do you mean there are chances that the data can be like this?
1000 - 1 - Data (text)
1000 - 2 - Data (text)
1000 - 3 - Data (text)
1000 - 4 - (empty)

Or maybe you can attach a sample file as it will be easy that way to update the code.