Alteryx Designer Desktop Discussions

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

Convert Text File into Columns and then CSV file

glombard
7 - Meteor

Hello Community,

 

I have a big challenge for me.

 

The user wants to convert a file with data like this:

000000001010200MAF FILE03.002023030903380620230308 MERCHANT SERVICES PROPRIETARY AND CONFIDENTIAL 000155
000000002070200024445000420489 001000003389SALLY BEAUTY #3389 840000001
000000003071200SALLY BEAUTY #3389 AUSTIN TX 76210 840CDT3751831745 1110000123751831745 1110000123751831745 1110000123751831745 111000012
00000000430020003072023150400001652105 88113205 376793XXXXX1005 10270000000432500000000000000000000005977AMEX 3895700701706001 0000000000099999993067500031447799
000000005306200 00000066001
00000000630020003072023192600001653105 08917Z05 515676XXXXXX5133 02260000000112500000000000000000000005977MCRDMWE 3897900302706001 0000000000002305373067500233128667 B1
000000007306200 00000066001
00000000830020003072023173300001652605 00793Z05 521333XXXXXX7099 08250000000217300000000000000000000005977MCRDMPL 3896900502206001 0000000000002305373067500243132519 B1
000000009306200 00000066001
00000001030020003072023193500001249605 06264Z05 526947XXXXXX9684 01240000000322300000000000000000000005977MCRDMCW 3891360003506001 0000000000002305373067500247984519 B1
000000011306200 00000066001
00000001230020003072023115500001247605 65298207 527493XXXXXX6957 10240000000078900000000000000000000005977MCRDMDJ 3890900001306001 0000000000002305373067500248542472 A1
000000013306200 00000066001

 

into a file like this

"Detail Flag","StoreNo","Amount","Tran Date","Tran Code","MerchID","MAFStore","GLObjID","GLDesc","MAFDivision","File Type","Merch ID Fees","MerchID Dep","Chg Back Adj","UserDefined10","State","Account"
"1","5","75236","20230308","CCSTLCR","4445090453431","5","","","000155001","POS","-16.50","756.59","0.00","","","14000"
"1","10","30374","20230308","CCSTLCR","4445090453472","10","","","000155001","POS","-5.24","298.50","0.00","","","14000"
"1","14","42835","20230308","CCSTLCR","4445090455444","14","","","000155001","POS","-8.22","420.13","0.00","","","14000"
"1","19","70563","20230308","CCSTLCR","4445090453282","19","","","000155001","POS","-14.80","749.67","0.00","","","14000"
"1","21","36910","20230308","CCSTLCR","4445090447144","21","","","000155001","POS","-6.85","415.42","0.00","","","14000"

 

How can I do this with Alteryx tools?

 

Regards,

Gilberto

3 REPLIES 3
ChrisTX
15 - Aurora

Can you provide sample input that matches the sample output you posted?

 

For the output you want like this:

1","5","75236","20230308",
"1","10","30374","20230308",

 

Does the input file contain "05" or "5" for the first record?

 

If you don't have a consistent input layout (where the data can shift left or right with data like "5" and "10" for the same field) and you don't have delimiters in the input file, it won't be possible to correctly "guess" where each field starts/ends.

 

Chris

glombard
7 - Meteor

Hello @ChrisTX 

 

Please find attached the files

 

Thank you for your help.

ChrisTX
15 - Aurora

Can you send 5 to 10 records, both input and expected output, with the records in the same order in both files?

 

I'm not able to match the first line from the CSV file to a record in the TXT file.

Labels