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.
SOLVED

Reading data from csv with data in the multiple rows

sriniprad08
11 - Bolide

Hi Team,

 

I need help. I have a situation where i have csv file with column names in single row but data is spread across two rows. I need to bring the second row of data in the same line as first row .

ideally the yyy should be part of xxx and the "0";"0";"0";"30" should be in the next column.

 

id;"vse_id";"vse_id";"vse_date_created";"vse_date_planned";"vse_priority_id";"vse_object_id";"vse_creator_id";"vse_dt_id";"vse_desc";"vse_recur_interval";"ese_last_instance";"vse_external_id";"vse_changer_id"
41;"41";"1";"2004-05-24 07:07:30";"2004-06-04 00:00:00";"3";"2908";"30";"1";"xxx
yyy";"0";"0";"0";"30"
21 REPLIES 21
sriniprad08
11 - Bolide

The output should be

 

idvse_idvse_idvse_date_createdvse_date_plannedvse_priority_idvse_object_idvse_creator_idvse_dt_idvse_descvse_recur_intervalese_last_instancevse_external_idvse_changer_id
41411################32908301xxxyyy00030
atcodedog05
22 - Nova
22 - Nova

Hi @sriniprad08 

 

Here is a workflow for the task.

Output:

atcodedog05_0-1605518760093.png

Workflow:

atcodedog05_1-1605518771663.png

 

Hope this helps 🙂


If this post helps you please mark it as solution. And give a like if you dont mind 😀👍

jdunkerley79
ACE Emeritus
ACE Emeritus

I would suggest:

jdunkerley79_0-1605518962812.png

 

First concatenate all the input into a single value with \n as the separator

Then using a Text to Columns tool split to rows on \n ignoring separators in quotes

You can then use a text to columns to split the columns up

 

Hopefully enough to get you going

 

sriniprad08
11 - Bolide

Hi @atcodedog05 

thank you so much. Actually the problem is little different there is a second row with yyy 0 ..0.. i need this to be in the first row as well. 

i have attached the sample output in my post.

 

Thanks,

Sriniv

atcodedog05
22 - Nova
22 - Nova

Hi @sriniprad08 

 

It has been added check the end of the output

atcodedog05_0-1605519193132.png

 

I took your expected output into consideration while building the workflow 🙂

 

atcodedog05
22 - Nova
22 - Nova

Hi @sriniprad08 

 

Use this input tool config

atcodedog05_0-1605519391203.png

So that your first row also comes as data and not as header.

 

atcodedog05
22 - Nova
22 - Nova

Happy to help 🙂 @sriniprad08 

 

Cheers and Happy Analyzing 😀

sriniprad08
11 - Bolide

Hi @atcodedog05 

 

Thank you. I am trying to upload a csv but not getting an option for "First row contains data". I am getting first row contains field names?

 

Also one more thing i observed my data is not only split across two rows but multiple rows. For example in my question the "xxx is split into two rows" like this "xxx

"yyy

"zzz 0, 0, 1,2

how to handle this?

 

thanks 

Sriniv

sriniprad08
11 - Bolide

Thank you @jdunkerley79  very helpful too.

Labels