Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Help on output character position

Karthikeyan_8588
5 - Atom

Hello All,

 

I am new to Alteryx, need your help for one of our use cases.

 

 1. Using input file we need to do certain calculation and joins - which is fine

 2. After completing the formulas and joins the output should save in text file based on the below Character position - Got stuck here

 

Bytes    Criteria
1-6        A
7-13      B
14-19    C
20-25    D
26-31    E
32-38    F

Ex : If one of my output value matched the Criteria under B then my output value should come between 7-13 position in text file similarly for other values.

 

I have no idea how to do this, it will be greatly helpful if some one advice me how to do this

 

4 REPLIES 4
Qiu
21 - Polaris
21 - Polaris

@Karthikeyan_8588 
Can you give a sample input and output?

Feels like the mid string function should do the work. 

Raj
16 - Nebula

To save the output in a text file with specific character positions based on the criteria, you can use the "Output Data" tool in Alteryx with a custom file format. Here are the steps to achieve this:

After completing the formulas and joins, connect the output to the "Output Data" tool.

In the "Output Data" tool, choose "Custom Delimited" as the file format.

Click on the "Advanced" tab and select the "Custom" option under "Field Delimiters".

In the "Custom Delimiter" field, enter a space character " ".

In the "Field Widths" section, specify the byte positions for each field based on the criteria. In your case, it would be:

Field 1: Width 6 (Criteria A)
Field 2: Width 7 (Criteria B)
Field 3: Width 6 (Criteria C)
Field 4: Width 6 (Criteria D)
Field 5: Width 6 (Criteria E)
Field 6: Width 7 (Criteria F)
Note that the sum of the field widths should be equal to the total number of bytes in the file, which is 38 in your case.

Map the output fields from the previous tools to the corresponding fields in the "Output Data" tool.

Run the workflow and the output will be saved in a text file with the specified character positions based on the criteria.

I hope this helps you achieve the desired output format in Alteryx.

Karthikeyan_8588
5 - Atom

Thanks for your response

I have attached the sample input and output file.

 

so the below is the criteria for placement , if the amount in input file is 1000 then the output of amount should be placed between 16th and 19th character of the text file

 

(Amount)  (Placement on file)

1000           16-19

2000           20-24

Karthikeyan_8588
5 - Atom

Hi Raj,

 

Thanks a lot for your suggestion, however iam not able to find custom delimiter on my output file option, iam using Alteryx Version: 2021.3.5.03604

 

Karthikeyan_8588_0-1684162628709.png

 

Labels