Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Parse SFTP file listing to columns using RegEx

RajR
6 - Meteoroid

Hello,

 

I am new to the community and haven't explored much on using RegEx yet. Looking for help in parsing the below SFTP file listing to columns. I need the file creation datetime and filename from the below listing to identify and download only the latest .dat * .control files.

 

-rw-rw---- 1 no-user no-group 11048 May 28 11:47 EX_RATES_20190528124700.dat
-rw-rw---- 1 no-user no-group 112 Jun 14 14:30 EX_RATES_20190614033005.control
-rw-rw---- 1 no-user no-group 11059 Jun 14 14:30 EX_RATES_20190614033005.dat

 

Thanks,

Raj

3 REPLIES 3
DataKyle
8 - Asteroid

The text to columns tool may be useful here as well. 

 

Set it up as space delimited and you can create the date time from there.

 

Capture.PNG

danilang
19 - Altair
19 - Altair

Hi @RajR 

 

I agree with @DataKyle.  No need for regex here.

 

WF.png

 

Use Text to Columns to parse out your 9 columns.  Build the file date from the month, day and time columns.  Summarize to get the most recent file

 

Results.png

Note that I added in a second input record for the last .dat file with a time of 14:31 to demonstrate the summarize. 

 

This method will have trouble around Jan 01, since the date info doesn't include the year.  

 

Dan

RajR
6 - Meteoroid

@Danilang and @kyledunn - thank you both for your help and the sample workflow. That worked fine.

 

Would you know why the download tool output to string for getting file listing from the SFTP server doesn't include the year for the file creation date?

 

Thanks,

Raj

Labels