I do this in one of my applications. The user will copy/paste either one column
or one row
(works the same) ofvalues into a dialog box. Here's my code. In my instance I
can stick the
data right into a where clause because the part#s will not have any spaces in
them.
Can you use any of this?
Karen
SET VAR vPartList TEXT = NULL DIALOG "You can enter a list of
Parts,separated by commas, or copy/paste from a spreadsheet." + vPartList
vendkey 20 CAPTION .vCaption OPTIONMESSAGE_FONT_SIZE 11 IF vPartList IS NULL
THEN GOTO stop ENDIF SET VAR vTab = (CHAR(009)) SET VAR vPartList =
(SRPL(.vPartList, .vTab,",", 0)) SET VAR vCRLF = (CHAR(013) + CHAR(010)) SET
VAR vPartList = (SRPL(.vPartList, .vCRLF,",", 0)) SET VAR vWhere= (.vWhere +
" AND custpart IN (" + .vPartList + ")")
-----Original Message-----
From: Doug Hamilton <[email protected]>
To: R:Base List <[email protected]>
Sent: Thu, Jul 15, 2021 2:03 pm
Subject: [RBASE-L] - How to load 1 col of text values from Excel into a table?
What is a good way to copy/paste rows from a column in a spreadsheet
into rows of a temp table?
The spreadsheet has a column of 10 character text values (part numbers),
the number of rows could range from a few to a hundred.
Users are comfortable highlighting the column and doing a Copy/Paste.
I want to avoid users having to export; c/p is easier for them.
I can paste the values into a variable memo and they display as a column
of text values, SFSG (So Far, So Good).
But when I try to parse through them to INSERT into a temp table, the
variable of part numbers is one long string of characters with no
delimiters. :(
I've tried text, note and varchar datatypes and different settings of
tabs & returns but in the interest of time, I seek the wisdom of this
List vs the number of testable permutations.
Or is there a better way than Paste & Parse? Directly into the temp table?
TIA,
Doug
RBGX5E
--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
--
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/2a23c700-17ee-aa2c-e30e-7a61694d6859%40wi.rr.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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rbase-l/374362038.248559.1626376367855%40mail.yahoo.com.