Skip to content

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].
  • fthomas Offline
  • Posts: 8
  • Joined: Fri Feb 24, 2017 9:40 am

remove blank lines from text file

Post 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?
  • Support_Rick Offline
  • Support Specialist
  • Posts: 590
  • Joined: Tue Jul 17, 2012 2:12 pm
  • Location: Phoenix, AZ
  • Contact:

Re: remove blank lines from text file

Post by Support_Rick »

Have you tried the "ModifyRowSet" task?
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
  • fthomas Offline
  • Posts: 8
  • Joined: Fri Feb 24, 2017 9:40 am

Re: remove blank lines from text file

Post by fthomas »

I thought about that.. And now I realize I wasn't employing it early enough in the process. That worked.
Post Reply