Alteryx Designer Desktop Discussions

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

Deleting First 10 Column but without deleting start and end rows

skotian1289
8 - Asteroid

Hello All, am sure this will be a quite simple solution however I need assistance as I am not able to achieve below results.

 

I want to delete the first 10 columns of my data however the start and end row need to remain intact as it contains FIle details . I am able to delete the columns however when I do that the first and end rows are also affected. I am attaching sample raw files and expected results files if it helps Thanks

18 REPLIES 18
vizAlter
12 - Quasar

@skotian1289 — Thank you for marking the solution accepted!

 

Just for being curious, I have tried a little more something... look at this solution (Get Columns_v4.yxmd) as well.

Now, you can export the exact format through Output tool (if want or learn):

 

vizAlter_0-1601021843382.pngvizAlter_1-1601021865565.png

 

skotian1289
8 - Asteroid

@vizAlter 

 

Your solution works amaing however I am stuck with a small glitch especially when both my input and output is a csv format with delimiter as ,  .

 

My Output looks sumthing like below in notepad++

 

File Name ver 10 ABC,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

"Column 1","Column 11","Column 12","Column 13","Column 14","Column 15"

"1","","","","","22","","","","","44","","","","","66","","","","77","","","","","88","","",""

END-File name,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

 

My only problem is the excess commas in first and last line rest double quotes and commas in other lines are perfect and matches our requirement. I tried to replace the commas in first and last line but they wont go and if I remove Delimiters in Output column all the delimiters in my output would disappear . Is there a way we can remove Delimiters only from specific places.

 

The issue is when we union the two CSV files there are blank spaces created in front of "File Name ver 10 ABC" and "END-File name" which is creating multiple delimiters. Not sure if its a alteryx glitch.

 

Thanks

 

skotian1289
8 - Asteroid

@grazitti_sapna 

@atcodedog05 

 

I am stuck with a small glitch especially when both my input and output is a csv format with delimiter as ,  . Is this an alteryx glitch because if manually do it these excess delimiters does not appear.

 

My Output looks sumthing like below in notepad++

 

File Name ver 10 ABC,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

"Column 1","Column 11","Column 12","Column 13","Column 14","Column 15"

"1","","","","","22","","","","","44","","","","","66","","","","77","","","","","88","","",""

"1","","","","","22","","","","","44","","","","","66","","","","77","","","","","88","","",""

END-File name,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

 

My only problem is the excess commas in first and last line rest double quotes and commas in other lines are perfect and matches our requirement. I tried to replace the commas in first and last line but they wont go and if I remove Delimiters in Output column all the delimiters in my output would disappear . Is there a way we can remove Delimiters only from specific places.

 

The issue is when we union the two CSV files there are blank spaces created in front of "File Name ver 10 ABC" and "END-File name" which is creating multiple delimiters. Not sure if its a alteryx glitch.

 

Thanks

atcodedog05
22 - Nova
22 - Nova

Hi @skotian1289 

 

The output is perfectly correct. There is extra commas in first and last line is created in CSV file to maintain the column count and format denotes that the column contains null values.

 

If you want to remove you can run it through another workflow and remove them.

 

Can you please provide the output .csv file.

 

You can run the .csv as text file with no delimiter and remove the extra commas from first and last line.

 

Hope this helps 🙂

skotian1289
8 - Asteroid

@atcodedog05 

 

Sure please see attached output sample in csv format. If you see the first and last row has extra comma delimiters which I am trying to remove, I tried the replace, Trim function but it wont go.

 

Thanks,

 

 

atcodedog05
22 - Nova
22 - Nova

Hi @skotian1289 

 

Here is the approach.

Set the input tool delimiter to "\0" (none delimiter)

atcodedog05_0-1602500053387.png

Output:

atcodedog05_1-1602500124656.png

 

Hope this helps 🙂

 

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

skotian1289
8 - Asteroid

@atcodedog05 

 

Is it necessary that we have to create a separate workflow altogether. Cant we use the same workflow which we created to delete the first 10 columns and get the expected output. I mean ur solution works but I am just curious as to why the Data Cleansing or TRIM or Replace function are not able to remove those extra commas ?

 

Thanks

 

atcodedog05
22 - Nova
22 - Nova

Hi @skotian1289 

 

In first workflow there is a delimiter comma as part of csv file which is creating multiple columns.

Second workflow its considering data as txt file with no delimiter hence only one column. 

 

Where in both workflow data format is different hence cannot be integrated in a single workflow easily.

There might be a possibility but its posses a risk of improper output.

 

Hope this helps 🙂 

atcodedog05
22 - Nova
22 - Nova

Happy to help 🙂 @skotian1289 

 

Cheers and Happy Analyzing 😀

Labels