Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Knowledge Base

Definitive answers from Designer Desktop experts.

Input .txt Files and Other File Types as Plain Text

MattD
Alteryx Alumni (Retired)
Created

Question

I know I can input .csvand other delimited text files - what about text (.txt) files?

Answer

Yes - you can input text (.txt) files! The approach described below applies to all delimited text files - and can also input other file types (like XML) as plain text.

Simply point your Input Data Tool to a file of your choice and specify the configuration options below:

image.png

The approach uses .csv as the File Format and the \0 (none) delimiter to keep from delimiting the file, inputting it as asingle body of text. Since the whole of the file is being input as one string field, you'll have to enter an adequate string length to capture all the file's contents (9999 in the above - you can use an Auto Field Tool to minimize this after inputting). This will usually mean keeping from using the first row of the file as field names, so pay mind to Option 6 (unchecked).

Once the file is input as a single block of text, the Text to Columns Tool can makeshort workof parsing it into a tabulated format!

The technique shown above can also help to workaround common input errors from delimited files.

Comments
MLRM
6 - Meteoroid

Can you make this an Application where the characteristics Selected above apply to whatever TXT Input is selected? 

kylechalmers
5 - Atom

I need the above comment answered for my application as well!


PreetiVatnani
6 - Meteoroid

hello,

I have a similar problem   working file,

I am having troubles

1. how to input this file in alteryx.

2. How to get contents line 2 in line with line 1.... every entry is in 2 parts, line 1 and line 2 should be placed against each other. similarly Line 3 and 4 should be against each other. I dont know how i can do that

 

example of text file (8 lines 😞

4010 VISA OUTGOING CC 000000 : ALT CUR CAD 2
GL 1520VSA02E800CACAD ALT 8118 C 999998 OFFSET: N PRIOR: N : ( 34,214,760.94)
4020 VISA INTERCHANGE INCOME DOMESTIC CC 000000 : ALT CUR CAD 3
GL 6355VSA00E901CACAD ALT OFFSET: N PRIOR: N : ( 4,207,893.30)
4025 VISA INTERCHANGE INCOME INTERNATIONAL CC 000000 : ALT CUR CAD 3
GL 6355VSA00E901CACAD ALT OFFSET: N PRIOR: N : ( 568,056.28)
4040 VISA INTERCHANGE EXPENSE DOMESTIC CC 000000 : ALT CUR CAD 4
GL 6356VSA00E901CACAD ALT OFFSET: N PRIOR: N : 125,144.08

NeilR
Alteryx Alumni (Retired)

@PreetiVatnani how about this?

workflow.png

PreetiVatnani
6 - Meteoroid

hi 

Thank you so much for the help. This gives me a good idea of how i can do some workarounds,

Unfortunately, it doest work on my text file. May i share the file separately on a thread with you please?

 

NeilR
Alteryx Alumni (Retired)

@PreetiVatnani yes feel free

PreetiVatnani
6 - Meteoroid

I need help again with my text file. This file has records of data but in beginning of every page it has some basic account information added which i need to remove. I want this account information to be extracted as a column and not after each page. also, end of my file has a conclusion statement, closing value, sum etc. Not sure how to remove them as this data will not always appear on line number X. It depends on number of transactions where the concluding line will be.

please help

clipboard_image_0.png

 

 

clipboard_image_1.png

NeilR
Alteryx Alumni (Retired)

@PreetiVatnani please start a new Designer discussion (here) so that you can attach the file.

PreetiVatnani
6 - Meteoroid

 

" The maximum number of attachments has been reached. Maximum number of attachments allowed is: {0} "

clipboard_image_0.png

NeilR
Alteryx Alumni (Retired)

@PreetiVatnani i'm seeing that too, but if you just click the browse link and upload the file it works anyway.

sahartz
8 - Asteroid

Hi,

 

@MattD I have 20 txt files that I need to input. Is there a way to define your solution in 1 time or do I need to go file by file?