Inspire EMEA 2022 On-Demand is live! Watch now, and be sure to save the date for Inspire 2023 in Las Vegas next May.
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!

Bengaluru, IN

Welcome to the Bengaluru User Group

Click in the JOIN GROUP button in Home to follow our news and attend our events!

SOLVED

How to Configure the Input tool to Import the data from .flat file

stj1120
8 - Asteroid

 

Hi all,

 

I have a text file with the extension '.flat'.  I tried multiple ways in configuring the Input tool. But, no luck. All the time, I'm getting an error as the  "Missing root element 'flatfile' "

 

I'm unable to attach the  .flat file here as it is not allowing me to attach. Can anyone please help in configuring the Input toool to import the data from .flat file. 

 

 

sreenivasateja_0-1587185575318.png

 

Awaiting your responses.

 

Thank you.

 

Br,

Sreenivasa Teja.

 

4 REPLIES 4
atcodedog05
22 - Nova
22 - Nova

Hi @stj1120,

 

I am new to .flat file too.

But i didnt want to shy away from exploring it and trying to help.

 

Hence i did some research on it. I was able to find out alteryx input tool has a connection for .flat file.

Was able to see you are using the same.

I did some experimentation, was able to find out that .flat file gives headers and .asc file packages with it gives the data. And both files are required to handle .flat file.

 

FYI there are like no sample .flat available on the internet. Hence my experimentation were limited.

 

I tried few things.

was able to read the sample .flat provided by alteryx

was able to read a csv and output it to a .flat

was able to read the outputted .flat file

 

I used default configuration to read the file.

atcodedog05_0-1587196154915.png

 

Hence i would suggest you to check whether you have a the .asc file with. If it is there. You might want to give it a shot by renaming the files. If both dont work.

Please share the files over drive link. Or else there will be very limited ways on how people can help. 

 

PS: in between if you already found the solution please share it with us.

Looking forward to hear from you.

 

Thank you for sharing this scenario. It was a great learning.

Happy Analyzing : )

atcodedog05
22 - Nova
22 - Nova

Hi @stj1120,

 

I was able to recreate the error.

atcodedog05_0-1587199101804.png

 

The expected .flat file format.

atcodedog05_1-1587199157914.png

 

You get error when it doesnt start with a <flatfile version="1"> which is the root element of XML file. Like below.

atcodedog05_3-1587199255654.png

 

Hence you might want to check the .flat file for the structure. Should start with <flatfile version="1">.

Below is a simulation snapshot of both scenarios.

 

atcodedog05_4-1587199378053.png

 

Hope that solves your problem.

 

If not please share your files over zip or drive so that we can better help you.

 

Thank you for sharing this scenario. It was a great learning.

Happy Analyzing : )

stj1120
8 - Asteroid

Hi @atcodedog05 

 

Thank you for your response.

 

But, I have the unstructured data in the .flat file like below and there is no any xml structure for this.

 

sreenivasateja_0-1587267016201.png

 

I don't know how to resolve this. I have attached the  .flat file in the zip file.  Kindly provide me the solution.

 

Awaiting your response.

 

Thank you.

 

 

atcodedog05
22 - Nova
22 - Nova

Hi @stj1120 ,

 

The file which you are using doesn't qualify to be a .flat file. Hence Alteryx cannot directly read with .flat extension.

 

But the file can be read and parsed by treating as a .txt file. Rename the file extension to .txt from .flat

 

atcodedog05_0-1587276198534.png

Browse for the file and read it with below configuration.

atcodedog05_1-1587276343133.png

 

The file will be read like below.

atcodedog05_2-1587276398709.png

 

Use the below workflow to parse the data.

atcodedog05_3-1587276495621.png

The parsed output data looks like this.

atcodedog05_4-1587276556410.png

 

Please let me know if this is the desired output.

 

I hope this helps your purpose. If there is still anything specific you are looking for please reply back.

And i am sorry that your file cant be read directly as a .flat file.

 

PS: really appreciate that you were able to provide the file or else it would have been harder to provide solution.

 

Thank you for sharing this scenario. It was a great exposure.

Happy Analyzing : )

 

Labels