Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Could someone let me know to how get rid of unknown characters from the text file.

vgeetanp
7 - Meteor

For Example :

 

I have a text in my text file (below)  wherein while importing it into the workflow I need to view it by ignoring the unknown character. Refer Below.

 

vgeetanp_0-1596551564686.png 

          To 

 

vgeetanp_1-1596551693973.png

 

Is it easy to do ? Thanks.

18 REPLIES 18
vgeetanp
7 - Meteor

Thank you Krishna. The Data Cleansing helps to get rid of the unwanted character BUT it removes all the extra spaces too, which makes the column separation task tough. 

 

ms dhoni Y Y N
Virat Kohli Y N
Raina Y N

 

Would you be able to assist me on how to get this done.? The txt file and the expected output is attached in the above reply.

Thanks in advance.

 

vgeetanp
7 - Meteor

Thank you Krishna.. The Data Cleansing helps me to get rid of the unwanted character BUT it removes the extra spaces (refer below image) too, which makes the column separation task tough. 

 

vgeetanp_0-1596608322529.png

 

 

Would you be able to get this done ? The txt file and the expected output is attached in the above reply.

Thanks in advance.

joshbennett
11 - Bolide
11 - Bolide

Interesting find, @KrishnaKuchibhotla - it seemed somewhat strange to me that the Data Cleansing tool is removing this character with the 'Tabs, Line Breaks, and Duplicate Whitespace' setting. After some playing with this in regexr.com, I discovered this pesky little character is a "form feed" character, which apparently is also covered by "\s+" in RegEx (which is what the Data Cleansing tool uses for the 'Tabs, Line Breaks, and Duplicate Whitespace' setting, which is why this solution appeared promising).

 

@vgeetanp  - given this, an alternative to using the Data Cleansing tool which is removing additional characters you wish to keep would be to use the following formula:

 

 

 

regex_replace([Field_1], "\f", "")

 

 

 

The "\f" (i.e., representing "form feed" characters) is what targets your specific undesired character, while leaving the rest of your data as is (though I did notice that it also appears to convert null records to empty / blank records, but this didn't seem like it would be a deal breaker). 

 

DextersLaboratory_0-1596687686981.png

 

 

Workflow attached for your reference - hope this helps.

vgeetanp
7 - Meteor

Woow @joshbennett .. That's Perfect!! This is what I looked for.. Thank You..

 

I would like to ask one more favor.. Could you please let me know the best practice to convert the given text file into the expected output. Both files are attached previously.

 

Output Required:

 

vgeetanp_0-1596688325008.png

 

 Thanks in advance.

joshbennett
11 - Bolide
11 - Bolide

Assuming your input file(s) have the same report header (rows 1-7), this should do the trick:

 

DextersLaboratory_0-1596690679157.png

 

 

See attached for workflow - boom!

vgeetanp
7 - Meteor

Thanks for the swift response. I almost got it done.. BUT have one small issue. The last fields seems to be taking incorrect values. 

 

The output should be : 

vgeetanp_0-1596691154422.png

 

Whereas your solution gives the below :

vgeetanp_1-1596691177485.png

 

Could you please check that and share me the updated solution ?

joshbennett
11 - Bolide
11 - Bolide

Third time's the charm.

 

DextersLaboratory_0-1596691711682.png

 

vgeetanp
7 - Meteor

Thanks alot buddy @joshbennett .. You are a STAR!

joshbennett
11 - Bolide
11 - Bolide

Any time - and gee, thanks.

 

DextersLaboratory_0-1596693462589.png

 

Labels