I've attached a neat little function which will take any string which contains a list of values delimited by any character you choose and will convert it to an array. For you to make use of this, you have 2 options. One, make use of your database with the long fields, or alternatively write a little routine to read the file in one line at a time. Either way, you'll have one line to pass to ListToArray, eg...
ListToArray(cMyVeryLongStringList, Chr(9)).
Once you have your array you can then dump it to the correct destination database using your favourite scatter (or is it gather?) function.
Have fun with it, Ya Pal,
KMC
/*----------------------------------------------------------------------------
Function: ListToArray
------------------------------------------------------------------------------
Purpose: Convert a delimited string to an array
------------------------------------------------------------------------------
Parms: (1) The string to be parsed (may contain several delimiters)
(2) The delimiter character (defaults to ","

(3) An option string, indicating how each element is trimmed etc
N - No trimming of elements (by default, blanks are trimmed)
D - If string is empty, returns {""} i.e. an array with one
dummy element. Default is to return an empty array {}.
------------------------------------------------------------------------------
Returns: An array, with each element containing a segment of the string
------------------------------------------------------------------------------
Notes: Examples of usage:
aRes := ListToArray("AB, BC,CD "

// Result: {"AB","BC","CD"}
aRes := ListToArray("A, B, C ",,"N"

// Result: {"A"," B"," C "}
aRes := ListToArray("A; B; C",";"

// Result: {"A","B","C"}
aRes := ListToArray(" "

// Result: {}
aRes := ListToArray(" ","D"

// Result: {""}
----------------------------------------------------------------------------*/
FUNCTION ListToArray ( cList, cDelimiter, cOptions )
local nPos
local aList := {} // Define an empty array
local cToken // Token in the list
local lMore := .T.
local lTrim := .T.
local nDelimLen
DEFAULT ( cDelimiter, "," )
nDelimLen := Len(cDelimiter)
if .not.Empty(cOptions) // Deal with the Options (if any supplied)
cOptions := Upper(cOptions)
lTrim := .not.("N" $ cOptions)
if Empty(cList) .and. .not.("D"$ cOptions) // Unless D, return an empty
lMore := .F. // array if string is blank.
endif
endif
do while lMore
nPos := at(cDelimiter, cList)
if nPos > 0 // If found a delimiter
cToken := substr(cList,1,nPos-1) // Extract token
else
cToken := cList // Else use remainder of str
lMore := .F.
endif
if lTrim
cToken := AllTrim(cToken) // Trim unless asked not to
endif
aAdd ( aList, cToken ) // Add a new element
cList := substr(cList, nPos+nDelimLen)
enddo
RETURN aList // End of function ListToArray