6/17/21: We have completed maintenance for the Search functionality on the Community. If you are seeing any issues, please try to clear your cache first. If the issue persists please email Community@alteryx.com

Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

Replace ascii delimiters

johnwillcox
5 - Atom

I am trying to parse a tar file that uses an ascii character as the delimiter, but I cannot find how to either get Alteryx to recognize it or successfully write a formula to replace it with, for example, a pipe

 

I have attached the data as a csv file

 

johnwillcox_1-1581596562625.png

 

Here is some info from Apple  about the file formatting

 

https://affiliate.itunes.apple.com/resources/documentation/itunes-enterprise-partner-feed/

File Format

Each file in the feed is in plain text format, separated into columns and rows. Each record has the same set of fields. The following are the delimiters for each field and record:

  • Field Separator (FS): SOH (ASCII character 1)
  • Record Separator (RS) : STX (ASCII character 2) + “n”

For example, these characters are represented in programming languages as shown below:

Perl:

$field_separator = chr(1); $record_separator = chr(2) . "n";

Java:

String fieldSeparator = String.valueOf((char)1); String recordSeparator = String.valueOf((char)2) + "n";

5 REPLIES 5
DavidP
16 - Nebula
16 - Nebula

It looks like the ascii character is ASCII code 05. You can use a regex replace tool to replace it with a | and then use a regular text to columns to parse the columns. 

 

Like this (mocked up example with input file attached)

 

DavidP_0-1581601524793.png

 

DavidP
16 - Nebula
16 - Nebula

If it's a different ascii character, just amend the number 05 in the regex tool.

johnwillcox
5 - Atom

Thanks, when I connect the .csv or the .tar to the Regex pill. Column to parse has 'No valid columns'?

 

johnwillcox_0-1581603165419.png

 

DavidP
16 - Nebula
16 - Nebula

In the Input data tool, uncheck option 6 First row contains Field Names

johnwillcox
5 - Atom

Thanks

Labels