Re: [RBASE-L] - Capture a file Name possible

2021-07-27 Thread 'Karen Tellef' via RBASE-L
Cool!  Glad that's what you needed
Karen
 
 
 
-Original Message-
From: 'jim schmitt' via RBASE-L 
To: 'Karen Tellef' via RBASE-L 
Sent: Tue, Jul 27, 2021 8:14 am
Subject: Re: [RBASE-L] - Capture a file Name possible

 Hi, Karen:

OMG.it works beautifully.. I only had to make one modification, and it 
was off and running.
I appreciate it so much..

Thanks again.

Jim
 On Monday, July 26, 2021, 12:11:11 PM EDT, 'Karen Tellef' via RBASE-L 
 wrote:  
 
 Ah, that's the piece of info we all needed.  So the user is NOT going to pick 
the file?  So then the file is going to be sitting somewhere in a directory and 
you just want to pick up the file?
One way is to get a DIR of the directory into a file, load it into a table and 
then use a SELECT... INTO  to get the filename.  Of course you would add lots 
of error checking.  But code like the following
Karen

  OUTPUT c:\temp\file.txt
  DIR d:\YourDir\*.csv
  OUT SCR

  DROP TABLE tmpFile
  CREATE TEMP TABLE tmpFile (dirfiledate TEXT 10, dirfiletime TEXT 8, +
    dirfilesize TEXT 10, dirFilename TEXT 100 ) 
  
  SET NULL -0-  
  LOAD tmpFile FROM c:\temp\file.txt AS FORMATTED USING +
    dirfiledate 1 10, dirfiletime 13 20, dirfilesize 31 40 dirfilename 42 141
  SET NULL ' '  
      DELETE ROWSFROM tmpFile WHERE dirfilename IS NULL OR dirfilename LIKE 
'byte%' +
    OR dirfilename = '.' OR dirfilename = '..' OR dirfiledate CONTAINS 
'directory'

 
 
 
-Original Message-
From: 'jim schmitt' via RBASE-L 
To: rbase-l@googlegroups.com
Sent: Mon, Jul 26, 2021 10:46 am
Subject: Re: [RBASE-L] - Capture a file Name possible

 Hi, Tony ,

Thanks for the speedy reply , but there will be only one PAYMENTScsv 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 
 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  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 
 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 rbase-l+unsubscr...@googlegroups.com.
 To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/1438844295.721301.1627265246989%40mail.yahoo.com.
 
  
 
  -- 
 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 rbase-l+unsubscr...@googlegroups.com.
 To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/CABnhDARk-7tS5u0t4NC6WmUecE%2B0ONhey4AZddev6VraCeSHjw%40mail.gmail.com.
 
 -- 
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- 
You received 

Re: [RBASE-L] - Capture a file Name possible

2021-07-27 Thread 'jim schmitt' via RBASE-L
 Hi, Karen:

OMG.it works beautifully.. I only had to make one modification, and it 
was off and running.
I appreciate it so much..

Thanks again.

Jim
 On Monday, July 26, 2021, 12:11:11 PM EDT, 'Karen Tellef' via RBASE-L 
 wrote:  
 
 Ah, that's the piece of info we all needed.  So the user is NOT going to pick 
the file?  So then the file is going to be sitting somewhere in a directory and 
you just want to pick up the file?
One way is to get a DIR of the directory into a file, load it into a table and 
then use a SELECT... INTO  to get the filename.  Of course you would add lots 
of error checking.  But code like the following
Karen

  OUTPUT c:\temp\file.txt
  DIR d:\YourDir\*.csv
  OUT SCR

  DROP TABLE tmpFile
  CREATE TEMP TABLE tmpFile (dirfiledate TEXT 10, dirfiletime TEXT 8, +
    dirfilesize TEXT 10, dirFilename TEXT 100 ) 
  
  SET NULL -0-  
  LOAD tmpFile FROM c:\temp\file.txt AS FORMATTED USING +
    dirfiledate 1 10, dirfiletime 13 20, dirfilesize 31 40 dirfilename 42 141
  SET NULL ' '  
      DELETE ROWSFROM tmpFile WHERE dirfilename IS NULL OR dirfilename LIKE 
'byte%' +
    OR dirfilename = '.' OR dirfilename = '..' OR dirfiledate CONTAINS 
'directory'

 
 
 
-Original Message-
From: 'jim schmitt' via RBASE-L 
To: rbase-l@googlegroups.com
Sent: Mon, Jul 26, 2021 10:46 am
Subject: Re: [RBASE-L] - Capture a file Name possible

 Hi, Tony ,

Thanks for the speedy reply , but there will be only one PAYMENTScsv 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 
 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  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 
 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 rbase-l+unsubscr...@googlegroups.com.
 To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/1438844295.721301.1627265246989%40mail.yahoo.com.
 
  
 
  -- 
 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 rbase-l+unsubscr...@googlegroups.com.
 To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/CABnhDARk-7tS5u0t4NC6WmUecE%2B0ONhey4AZddev6VraCeSHjw%40mail.gmail.com.
 
 -- 
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 rbase-l+unsubscr...@googlegroups.com.
To view th

Re: [RBASE-L] - Capture a file Name possible

2021-07-26 Thread 'Karen Tellef' via RBASE-L
Ah, that's the piece of info we all needed.  So the user is NOT going to pick 
the file?  So then the file is going to be sitting somewhere in a directory and 
you just want to pick up the file?
One way is to get a DIR of the directory into a file, load it into a table and 
then use a SELECT... INTO  to get the filename.  Of course you would add lots 
of error checking.  But code like the following
Karen

  OUTPUT c:\temp\file.txt
  DIR d:\YourDir\*.csv
  OUT SCR

  DROP TABLE tmpFile
  CREATE TEMP TABLE tmpFile (dirfiledate TEXT 10, dirfiletime TEXT 8, +
    dirfilesize TEXT 10, dirFilename TEXT 100 ) 
  
  SET NULL -0-  
  LOAD tmpFile FROM c:\temp\file.txt AS FORMATTED USING +
    dirfiledate 1 10, dirfiletime 13 20, dirfilesize 31 40 dirfilename 42 141
  SET NULL ' '  
      DELETE ROWSFROM tmpFile WHERE dirfilename IS NULL OR dirfilename LIKE 
'byte%' +
    OR dirfilename = '.' OR dirfilename = '..' OR dirfiledate CONTAINS 
'directory'

 
 
 
-Original Message-
From: 'jim schmitt' via RBASE-L 
To: rbase-l@googlegroups.com
Sent: Mon, Jul 26, 2021 10:46 am
Subject: Re: [RBASE-L] - Capture a file Name possible

 Hi, Tony ,

Thanks for the speedy reply , but there will be only one PAYMENTScsv 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 
 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  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 
 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 rbase-l+unsubscr...@googlegroups.com.
 To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/1438844295.721301.1627265246989%40mail.yahoo.com.
 
  
 
  -- 
 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 rbase-l+unsubscr...@googlegroups.com.
 To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/CABnhDARk-7tS5u0t4NC6WmUecE%2B0ONhey4AZddev6VraCeSHjw%40mail.gmail.com.
 
 -- 
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 rbase-l+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/ca4e5ff7-dd79-4c48-4c52-eb399652b41f%40cio-bv.nl.
  -- 
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- 
You received this mess

Re: [RBASE-L] - Capture a file Name possible

2021-07-26 Thread 'jim schmitt' via RBASE-L
 Hi, Karen ,

Thanks for your reply , but there will be only one PAYMENTScsv file each 
day, and I would like to get the file name without having the operator choose 
it.
If I could get the name in a var, I could parse the data and capture the date.
I did think of the 'loadiflenameplus' option but i'm trying to avoid having 
operator choose something..
Maybe it's not possible?

Thanks again,
Jim On Monday, July 26, 2021, 09:26:23 AM EDT, 'Karen Tellef' via RBASE-L 
 wrote:  
 
 Jim:  Assuming your user will be selecting the file to process?  Use this 
statement to capture the name of the file into variable vFilename, then parse 
it like the code in another response.

PLUGINS loadfilenameplus.rbl 'vFilename|fullpath on +
    |TITLE Please selectyour Supplier Invoice Excel file+
    |VIEW_MODE Details +
    |FULLPATH ON +
    |NO_CHANGE_DIR ON + 
    |INITIAL_DIR x:\docs\supplier recordsand invoices' 
 Karen

 
-Original Message-
From: 'jim schmitt' via RBASE-L 
To: rbase group 
Sent: Sun, Jul 25, 2021 9:07 pm
Subject: [RBASE-L] - Capture a file Name possible

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 rbase-l+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/1438844295.721301.1627265246989%40mail.yahoo.com.


-- 
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 rbase-l+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/1952665032.1048804.1627305975942%40mail.yahoo.com.
  

-- 
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 rbase-l+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/2127193461.837781.1627314616287%40mail.yahoo.com.


Re: [RBASE-L] - Capture a file Name possible

2021-07-26 Thread 'jim schmitt' via RBASE-L
 Hi, Tony ,

Thanks for the speedy reply , but there will be only one PAYMENTScsv 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 
 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  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 
 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 rbase-l+unsubscr...@googlegroups.com.
 To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/1438844295.721301.1627265246989%40mail.yahoo.com.
 
  
 
  -- 
 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 rbase-l+unsubscr...@googlegroups.com.
 To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/CABnhDARk-7tS5u0t4NC6WmUecE%2B0ONhey4AZddev6VraCeSHjw%40mail.gmail.com.
 
 

-- 
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 rbase-l+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/ca4e5ff7-dd79-4c48-4c52-eb399652b41f%40cio-bv.nl.
  

-- 
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 rbase-l+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/807717408.839292.1627314401541%40mail.yahoo.com.


RE: [RBASE-L] - Capture a file Name possible

2021-07-26 Thread paul
Jim,

 

There are some great file utilities in the Plugin Power Pack. My personal 
favorite is LoadFileNamePlusPlus that, by default, defines all these variables:

 

vLFNFileCount = 1  INTEGER

vLFNFileName1 = C:\RBTI\ProgrammingInRBASE.pdf TEXT

vLFNFilePath1 = C:\RBTI\   TEXT

vLFNFileNameS1 = ProgrammingInRBASE.pdfTEXT

vLFNFileExt1 = .pdfTEXT

vLFNFileDT1 = 12/03/2015 15:08:58  TEXT

vLFNFileDateTime1 = 12/03/2015 15:08:58DATETIME

vLFNFileSize1 = 2084068INTEGER

vFileName = OK  TEXT

 

Worth a look in my opinion.

 

Good luck,

Paul Buckley

 

From: rbase-l@googlegroups.com  On Behalf Of Tony 
IJntema
Sent: July 26, 2021 2:50 AM
To: rbase-l@googlegroups.com
Subject: Re: [RBASE-L] - Capture a file Name possible

 

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  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 
mailto:rbase-l@googlegroups.com> > 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 rbase-l+unsubscr...@googlegroups.com 
<mailto:rbase-l+unsubscr...@googlegroups.com> .
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_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 rbase-l+unsubscr...@googlegroups.com 
<mailto:rbase-l+unsubscr...@googlegroups.com> .
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_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 rbase-l+unsubscr...@googlegroups.com 
<mailto:rbase-l+unsubscr...@googlegroups.com> .
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_source=footer>
 .

-- 
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- 
You received

Re: [RBASE-L] - Capture a file Name possible

2021-07-26 Thread 'Karen Tellef' via RBASE-L
Jim:  Assuming your user will be selecting the file to process?  Use this 
statement to capture the name of the file into variable vFilename, then parse 
it like the code in another response.

PLUGINS loadfilenameplus.rbl 'vFilename|fullpath on +
    |TITLE Please selectyour Supplier Invoice Excel file+
    |VIEW_MODE Details +
    |FULLPATH ON +
    |NO_CHANGE_DIR ON + 
    |INITIAL_DIR x:\docs\supplier recordsand invoices' 
 Karen

 
-Original Message-
From: 'jim schmitt' via RBASE-L 
To: rbase group 
Sent: Sun, Jul 25, 2021 9:07 pm
Subject: [RBASE-L] - Capture a file Name possible

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 rbase-l+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/1438844295.721301.1627265246989%40mail.yahoo.com.

-- 
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 rbase-l+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/1952665032.1048804.1627305975942%40mail.yahoo.com.


Re: [RBASE-L] - Capture a file Name possible

2021-07-26 Thread Tony IJntema
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  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 
mailto:rbase-l@googlegroups.com>> 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 rbase-l+unsubscr...@googlegroups.com
.
To view this discussion on the web visit

https://groups.google.com/d/msgid/rbase-l/1438844295.721301.1627265246989%40mail.yahoo.com

.



--
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 rbase-l+unsubscr...@googlegroups.com 
.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/CABnhDARk-7tS5u0t4NC6WmUecE%2B0ONhey4AZddev6VraCeSHjw%40mail.gmail.com 
.


--
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 rbase-l+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/ca4e5ff7-dd79-4c48-4c52-eb399652b41f%40cio-bv.nl.


Re: [RBASE-L] - Capture a file Name possible

2021-07-25 Thread 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  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 <
rbase-l@googlegroups.com> 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 rbase-l+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rbase-l/1438844295.721301.1627265246989%40mail.yahoo.com
> 
> .
>


-- 
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 rbase-l+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/CABnhDARk-7tS5u0t4NC6WmUecE%2B0ONhey4AZddev6VraCeSHjw%40mail.gmail.com.