remove blank lines from text file

Post any question you may have in regards to GoAnywhere MFT and let our talented support staff and other users assist you.
If you need a quicker response, please create a support ticket via the customer portal my.goanywhere.com or contact our support team by email at [email protected].
3 posts Page 1 of 1

fthomas

Posts: 8
Joined: Fri Feb 24, 2017 9:40 am

Post by fthomas » Wed Apr 05, 2017 2:55 pm
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?

Support_Rick

Support Specialist
Posts: 590
Joined: Tue Jul 17, 2012 2:12 pm
Location: Phoenix, AZ

Post by Support_Rick » Thu Apr 06, 2017 9:14 am
Have you tried the "ModifyRowSet" task?
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696

fthomas

Posts: 8
Joined: Fri Feb 24, 2017 9:40 am

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