Jim:

"I have an application where the operator will be receiving a CSV 'payments' file each day ... "

(1) By which system/protocol (e.g. smtp, ftp) is the file transmitted to your application at present time? (2) Does the transmission/file arrive within a consistent time range, and/or reliably by a given time of day?

Bruce

Bruce A. Chitiea | SafeSectors, Inc.
112 Harvard Ave #272 | Claremont CA 91711-4716 | USA
[email protected] | +011 (909) 238-9012 c | +011 (909) 912-8678 f


------ Original Message ------
From: "'jim schmitt' via RBASE-L" <[email protected]>
To: [email protected]
Sent: 7/26/2021 8:46:41 AM
Subject: Re: [RBASE-L] - Capture a file Name possible

Hi, Tony ,

Thanks for the speedy reply , but there will be only one PAYMENTS....csv file each day, and I would like to get the file name without having the operator to choose it. If I could get the name in a var, I could parse the date and capture the date.

Thanks,
Jim
On Monday, July 26, 2021, 02:49:51 AM EDT, Tony IJntema <[email protected]> wrote:


If the filename does not have always the same length, you can use a procedure like this


  -- capture the file name using procedure of Tony Luck
  SET VAR vfile  = 'PAYMENTS_637467300105556434-20210120-030011.csv'
  -- (SLOCP(TextNoteVarcharValue,string,occurrence))
  -- assuming '-' is always used in the filename
  -- locate startposition
  SET VAR V_STARTPOSITION = ( (SLOCP(.vfile ,'-',1)) + 1)
  -- (SGET(text,nchar,pos))
  -- get datevalue as a textvalue
  SET VAR V_PAYMENTDATE_TXT TEXT = (SGET(.vfile ,8,.V_STARTPOSITION) )
  -- (RDATE(mon,day,yr))
  -- convert text value to a date value
SET VAR V_PAYMENTDATE DATE = (RDATE( (NINT( (SGET(.V_PAYMENTDATE_TXT,2,5)) )), (NINT( (SGET(.V_PAYMENTDATE_TXT,2,7)) )), (NINT( (SGET(.V_PAYMENTDATE_TXT,4,1)) )) ))

-- Regards

Tony IJ





Op 26-07-2021 om 04:39 schreef Tony Luck:
There's a few ways to achieve that, here's one I use to capture the file name of a file we import twice daily using a CHOOSE statement that popups up the files for the operator.
CHOOSE vfile FROM #LFILES IN &vdirfile TITLE 'Press ESC to Exit' +
CAPTION 'Am Data Import File' OPTION LIST_FONT_SIZE 12 +
TITLE_FONT_SIZE 12 | TITLE_FONT_COLOR BLUE

From there, if the file name always places the date in the same spot you can use SGET function to extract it.

P.S. I use an ampersand variable to store the network directory the file is loaded to.

On Mon, Jul 26, 2021 at 12:07 PM 'jim schmitt' via RBASE-L <[email protected]> wrote:
Hello, Group:

I have an application where the operator will be receiving a CSV 'payments' file each day and the file has a rather long file name.

Sample file name: PAYMENTS_637467300105556434-20210120-030011.csv

Notice that the processing date (20210720) is buried inside the file name.

Is it possible within RBASE to programmatically capture the file name in a variable so that I can interrogate the variable to obtain the processing date ?

Thanks,

Jim
--
For group guidelines, visit http://www.rbase.com/support/usersgroup_guidelines.php
---
You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rbase-l/1438844295.721301.1627265246989%40mail.yahoo.com <https://groups.google.com/d/msgid/rbase-l/1438844295.721301.1627265246989%40mail.yahoo.com?utm_medium=email&utm_source=footer>.


--
Regards
Tony
--
For group guidelines, visit http://www.rbase.com/support/usersgroup_guidelines.php
---
You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rbase-l/CABnhDARk-7tS5u0t4NC6WmUecE%2B0ONhey4AZddev6VraCeSHjw%40mail.gmail.com <https://groups.google.com/d/msgid/rbase-l/CABnhDARk-7tS5u0t4NC6WmUecE%2B0ONhey4AZddev6VraCeSHjw%40mail.gmail.com?utm_medium=email&utm_source=footer>.

--
For group guidelines, visit http://www.rbase.com/support/usersgroup_guidelines.php
---
You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rbase-l/ca4e5ff7-dd79-4c48-4c52-eb399652b41f%40cio-bv.nl <https://groups.google.com/d/msgid/rbase-l/ca4e5ff7-dd79-4c48-4c52-eb399652b41f%40cio-bv.nl?utm_medium=email&utm_source=footer>.

--
For group guidelines, visit http://www.rbase.com/support/usersgroup_guidelines.php
---
You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rbase-l/807717408.839292.1627314401541%40mail.yahoo.com <https://groups.google.com/d/msgid/rbase-l/807717408.839292.1627314401541%40mail.yahoo.com?utm_medium=email&utm_source=footer>.

--
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- You received this message because you are subscribed to the Google Groups "RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/em1365d0b9-4796-49ab-bd76-67a3465abe73%40pathfinder.

Reply via email to