g-mitchell Absent Member.
Absent Member.
400 views

In a filter How to strip CR/LF from text

I'm a UNIX admin somewhat new to OO.

 

I am getting data from a web page, and I need to remove all the line feeds from it to make one big, long line that I will then sort into variables.

 

How is it possible to filter results and remove all CR LF characters to create one block of text.

Been looking at this a while and cannot figure a regex to do it. 

 

Kind Regards

Graham 

Labels (1)
0 Likes
3 Replies
Freakin Absent Member.
Absent Member.

Re: In a filter How to strip CR/LF from text

Why do you need it all on one line to grab variables?

0 Likes
Absent Member.. ntt00015 Absent Member..
Absent Member..

Re: In a filter How to strip CR/LF from text

Hi,

 

Have you tried to use replace filter in the outputs parameter of the operation? 

 

Kind Regards.

0 Likes
Chris_Powers Acclaimed Contributor.
Acclaimed Contributor.

Re: In a filter How to strip CR/LF from text

Graham,

 

I wanted to second an earlier post on using replace.

 

I had a similar requirement and tried for a while to use a scriptlet and reg ex to remove the linens and just like you have everything on one long line (I needed to get it into an Excel cell on one line).

 

So, in the operation, Step Results, I just added a variable from resultString and added a Replace filter.

 

For Find I hit return

Replace All

 

I needed to do a couple other things but for your question, think this will be much easier than RegEx.  If you need to separate the data you can just add something to the With line - maybe a ',' or ';'

 

Hope this helps.

-Chris

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.