Page 1 of 1

remove blank lines from text file

Posted: Wed Apr 05, 2017 2:55 pm
by fthomas
I have a project where I am:
saving the message body of an email to a text file.
Reading the flat text file at line 7, skipping empty rows (this strips out some unneeded header information)
performing a search and replace to remove a line of text at the bottom of the flat file with system.emptyString

The result is the lines of data I want and two blank lines. When I try to read this as a fixed width file to insert I am getting an invalid record error. Apparently this is due to the blank lines. If I manually remove the text at the bottom of the text file there are no errors.

What's the best way to delete blank lines from a flat or fixed width file?

Re: remove blank lines from text file

Posted: Thu Apr 06, 2017 9:14 am
by Support_Rick
Have you tried the "ModifyRowSet" task?

Re: remove blank lines from text file

Posted: Mon Apr 10, 2017 3:46 pm
by fthomas
I thought about that.. And now I realize I wasn't employing it early enough in the process. That worked.