Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Announcement | We'll be doing maintenance between 2-3 hours, which may impact your experience. Thanks for your patience as we work on improving the community!

Alteryx Designer Desktop Discussions

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

Reading Text File

dshaw
8 - Asteroid

I need some help reading in a text file with the following details:

 

Format:                           delimited text

Text Delimiter:                  none

Field Delimiter:                 ‘^|^’  (less the quotes)

Line Delimiter:                   cr/lf

 

Thanks,

Derreck

5 REPLIES 5
RolandSchubert
16 - Nebula
16 - Nebula

Hi @dshaw ,

 

you could load data without field separator (each line is one field then), replace "^|^" by "|" using a formula and split to columns using the Text to Columns tool with separator "|". What do you think?

 

Best

 

Roland

echuong1
Alteryx Alumni (Retired)

I second @Ron 's approach. The only thing I would add is to bring the file into Alteryx without field names so they can be parsed simultaneously. You can then use a dynamic rename to add the headers. See attached for an example. Let me know if that works! 

 

echuong1_0-1575652663908.png

dshaw
8 - Asteroid

I think this is all going into the right direction but I am still having an issue which may have to do with the Line Delimiter.  That is something that I am not familiar with. Also, I am not sure replacing the '^|^' is working since that delimiter is a long delimiter. So, perhaps the key is the Line Delimiter, first, then the Line Delimiter.  Attached are what the before and after looks like using your example.

 

Below are the instructions I received:

 

Format:                           delimited text

Text Delimiter:                  none

Field Delimiter:                 ‘^|^’  (less the quotes)

Line Delimiter:                   cr/lf

RolandSchubert
16 - Nebula
16 - Nebula

Hi @dshaw ,

 

I think, the problem is the number of columns you used in Text to Columns tool. You can adjust the number of columns in the tool:

 

08-12-_2019_17-06-07.png

This seems to be the easiest way to handle the problem, if the number of columns is identifcal for each record.

If the number of columns isn't identical for all records, you can split to rows a cross-tab then.

 

I've added a sample workflow (similar to the workflow created by @echuong1 ). Hope his solves your problem. If it still doesn't work, it would be helpful to provide a sample file.

 

Best

 

Roland

 

 

bzielinski11
5 - Atom

Hi @RolandSchubert - i came across this solution you posted and it was very helpful for me to get started. I am using this to read a text file with transaction data that is delimited with a #|# - the issue i am running into relates to one of the fields having line breaks. One of the fields in this transaction data is a "memo" line where the user can input any length and format of their own comments that relate to a given transaction row. There are multiple instances where a memo line contains multiple line breaks and I can't figure out how to get around this. each row. I can't post actual data but see below for an example:

bzielinski11_0-1669226079630.png

Any thought on how i could get past the line breaks? when i tried the workflow you uploaded the issue i ran into was each line break became column 1 again so there were a ton of rows that just had the data in the first column and the rest of the fields were null.

 

 

Labels