November 5, 200223 yr Newbies Hi! I want to import several lines of text (an abstract of an article) into one field. After the text comes a delimiter of my choice, currently "
November 5, 200223 yr First thing: text fields have a 64,000 character limit, so you won't fit 1MB of text into a single field be it global or not. One method is to write a simple looping script. First find all the records you want to concatenate and sort them into their appropriate order. (I'll assume that the text is in a field called "Lines" and it goes into a field called "gFull".) Then run this script: Set Field [gFull, ""] Go to Record/Request [first] Loop Set Field [gFull, gFull & Lines] Go to Record/Request [exit after last, next] End Loop To get your delimiters out use the Substitute() function: Set Field [gFull, Substitute(gFull, "
November 6, 200223 yr Author Newbies Hi! Thanks for replying and the script. I'll check it out. I think I'll try to make more clear what I want to do. In the DB each records has one particular field that contains this multiline content - abstracts from a article. There's only one abstract per record. One of these abstracts is someting in size of 1000 to 2000 characters long. So the content in this field (in one of the records) are also 1000 to 2000 characters. My source file is a plain text file with alot of abtracts, one after the other separated by
November 6, 200223 yr # Import all the text one line per record into the field "RawText" import[import order: RawText(text)] show all records unsort go to record/request [first] set field [gTextbuffer,""] # Loop through the raw text and gather it into global gTextbuffer loop if [patterncount(RawText,"*****")] # Separator found so save the text in a new "formatted" record # but first save the number of the current raw text record Set field [gRecordNo, Status(CurrentRecordNumber)] New Record/Request Set field [FormattedText, gTextbuffer] Set field [gTextbuffer, ""] Set field [RecordType, "Formatted"] # Now go back to the current raw text record Go to record [gRecordNo][by field value] Else # Not a separator, so add text to buffer Set field [gTextbuffer, gTextbuffer & "
Create an account or sign in to comment