Free Trial

Alteryx Designer Desktop Discussions

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

Importing a directory of cvs files

winnie
6 - Meteoroid

I'll have a folder of csv files, which follow the same format but with a varying number of rows at the beginning which I don't need.  (Also some stuff at the end I don't need)

I noticed the "Start Data Import on Line" option but this would be variable on how many rows of junk there are at the start.

 

I was thinking of making a macro so the action would be to update this value and update the file but since there's a directory, rather than just choosing a file - file browse for example I'm not sure how to do this.  It would have to read each file (and it struggles to read it properly even when I treat read errors as warnings since the number of columns for the junk is less than the columns in the actual data I want.

 

Any ideas would be appreciated!

 

Cheers

2 REPLIES 2
RodL
Alteryx Alumni (Retired)

Assuming that you are looking to keep the "Orders" data, I would try bringing in all of the files with a single input with wildcards and no delimiter.

 

Then I'd filter out anything that doesn't start with a date (using RegEx for the pattern matching), and then a Text-To-Column tool with a comma delimiter.

 

You'd then need to add a Select tool to eliminate the "full data" field and rename your columns.

 

Something like the attached...

winnie
6 - Meteoroid

Thanks!  That's great, and a lot less complicated than what I had in mind.

Labels
Top Solution Authors