Slobey Posted February 1, 2005 Posted February 1, 2005 hi all, I am trying to parse out two fields that have data and page numbers. The field contents look like the following: "THERE..............5" or "xxii; xix; 188; 188; 189" I want the first field to simply break into two new fields: "word" (THERE)and "occurance" (5). I did the occurance part with a rightword function. I tried the word with a leftword function but some are compound words using "-" or even some with apostrophe's. I know there is a way using length and position. Like anything to the left of the ... (some have more than 3). The second field I want to break into fields named for the page numbers and how many times it appears on that page, for example: field = "xxii" contents = 1 field = "xix" contents = 1 field = "188" contents = 2 field = "189" contents = 1 Any help would be greatly appreciated
rdhaden Posted February 1, 2005 Posted February 1, 2005 The first part's easy, but thinking about the second part makes my eyes cross. Context-sensitive field names? word = Left ( text; Position ( text ; "." ; 1 ; 1 ) - 1 ) occurrence = GetAsNumber ( Substitute ( text ; [ "." ; "" ] ; [ word ; "" ] ) )
Slobey Posted February 2, 2005 Author Posted February 2, 2005 Thanks that worked great. What I am really trying to do with the second part is to make a concordance for a book. I can keep the page numbers in a single field, but I want the user to be able to click on a page number and go to that page. Is there a way to do that without making a separate field for each page?
rdhaden Posted February 2, 2005 Posted February 2, 2005 How about a separate record for each page? Then you could script the parsing of each page to make a return-delimited text field that's the index for each page, with each word and the number of occurrences of that word on that page. Since you can match on any line of text in that return-delimited text field, you could then by relationship get occurrences across the whole book. The script that parses page by page would take awhile to run, but presumably you'd only have to do it once, unless this book is a work in progress. Does that make sense? If you've got multiple books, you could have 2 tables, Books and Pages, with each page having a foreign key BookID.
Slobey Posted February 2, 2005 Author Posted February 2, 2005 I am not sure I understand. I do have a separate record for each page. I have a separate table that already has each word in one record, the number of occurances in another and all the pages where it occurs in a third. I want the user to be able to type a word into a field and click a button and have a list of all pages where the word is. Then be able to click on a particular page to go to it. Excuse my ignorance but I am not entirely sure what a "return-delimited text field" is. Is it simply a field that has instead of: 1; 2; 3; it would be: 1 2 3 ? in which case I don't know how to make a button for a specific page. I don't know if I am making any sense at all.
Fenton Posted February 2, 2005 Posted February 2, 2005 If you have a return-delimited text field (which is exactly what you said in your last post) of all the pages where the word occurs, then create a relationship from that field to the Page# in the other Pages table. Use that relationship to create a portal (in the Words table). This will give you a row per matching page. Then you can click on a button in the row to go directly to that page.
rdhaden Posted February 2, 2005 Posted February 2, 2005 Yes, you understand return-delimited. If you've already got each word as its own record in a separate table, then forget the return-delimited text field. The user types a word into a global text field. That field is the left side of a relationship matching to the word field in your word table. In a portal you display the page number and occurrences with the word relationship. You have another relationship matching page number in the word table to page number in the page table. The portal row would be a button that you click on to go to related record using the page number relationship. You can also do cool things with Substitute and the text formatting functions to highlight the selected word in the text of the page, or all caps, or whatever. I'm not the greatest at thinking of these things in the abstract; I do much better actually playing with it. So maybe there's something I'm missing. But if you've already got all of the original text broken down into a page table and a word table, I think most of the hardest stuff is done.
Slobey Posted February 2, 2005 Author Posted February 2, 2005 Thank you guys so much, It helped alot. I appreciate your patience
Recommended Posts
This topic is 7303 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now