Jump to content

philipcaplan

Members
  • Content Count

    114
  • Joined

  • Last visited

Community Reputation

-2 Poor

About philipcaplan

  • Rank
    member

Profile Information

  • Gender
    Male
  • Location
    London, England

FileMaker Experience

  • Skill Level
    Intermediate
  • FM Application
    16 Client

Platform Environment

  • OS Platform
    Mac
  • OS Version
    MacOS X 10.13.3

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thanks comment. That doesn't quite work as I expected! Here's my calculation: Let ( [ lineStart = Position ( input ; "¶Your wording (up to" ; 1 ; 1 ) ; lineEnd = Position ( input ; ¶ ; lineStart + 1 ; 1 ) ; start = lineEnd + 1 ; end = "Image Choices" ] ; Middle ( input ; start ; (LineEnd - LineStart))) My 'input' includes the following text: Your wording (up to 500 letters/70 words) This is my wording of up to 70 words. On several lines. Optionally finishing with a return. Image Choices A small image (your Wording will run around it) The result I get is 2 lines only, truncated after the 4th char of the 2nd line: "This is my wording of up to 70 words. On s" when what I expected was all 3 lines: "This is my wording of up to 70 words. On several lines. Optionally finishing with a return." What have I done wrong??
  2. Sorry that I was not clear. Assuming the following as part of 'input': Your wording .......other text........ up to 140 characters This is the 1st line of the customer's wording [return] And this is the 2nd line [return] And this the 3rd & final thing the customer typed [maybe a return] Upload an image what I need is a calculation field which extracts the following: the text starting with "This is....." and ending with "the customer typed" [plus return if there is one] In other words, the "start" of extraction is marked by a line beginning "Your wording" and the "end" is marked by a line beginning "Upload an image"
  3. Hi. Could I ask for another version? At present, the "second one" extracts the text up the end of the line. What I need **also** is a version of that code which extracts all text (including any 'returns') from the beginning until the occurrence of specific text (such as "Image Choices")
  4. Thank you comment. The first one worked perfectly **AFTER** I included an "end of para" character at the end of the search string!! And the second one worked equally well, with the advantage that if I later make small changes to the web-form labels I don't have to remember to redo the FM db, as long as the first few (unique) words remain unchanged!! Thanks again.
  5. Thank you comment, but I believe you have misunderstood my data and my need...... Firstly, perhaps I should explain that the content of 'input' is copied-and-pasted from an online website-form result. The form has 6 fields which have data entered by a customer, plus 2 (Entry# and Date Submitted) which are added by the form-software. For example the line saying "Which CATEGORY would you like your Ad to be in?" is something which will always be the same in every record. The line saying "Category chosenxxx" was my test input to that field in the online form. SO -- THIS IS THE TEXT that will vary from record to record -- and is the text I want 'extracted' to be the content of the field 'extract_category' (which I actually forgot to include in the 8 fields I wanted!!!) If the line starting "Which CATEGORY etc etc" has to be included in full to be used that will do. But I would prefer if just the first 2 words were sufficient to identify it.
  6. I have a field called 'input' an example of whose content is shown below. I need to extract 8 pieces of information out of this, each into 8 separate fields named as follows: extract_entry_number extract_date_submitted extract_region_chosen extract_headline extract_wording extract_filename extract_email Can you please provide the best/easiest way (calculation?function?) for each of these 8 fields to be populated from the content of 'input' (Note: any of the 8 pieces of data 'input' can be of arbitrary lengths in different records) (Note: lines of text starting "Entry #:" and "Date Submitted:" and "Which" and "and which" and "Create a" and "Your wording" and "Upload an image" and "Your email" will always be the same every time) //////Example content for 'input'//////// Entry #:3 Date Submitted:02/04/2019 00:06 Which CATEGORY would you like your Ad to be in? Category chosenxxx and which Region? (leave blank for All London) Region chosenxxx Create a Headline for your Ad (up to 40 letters) Headline herexxx Your wording (maximum 140 letters + optional small image) or you can upload a JPEG or PDF file of your complete Ad. Wording of up to 140 chars herexxx Upload an image or logo file here... (JPG or PDF) jfa-favicon.png 2.36 KB Your email address (required) - will be used for confirmation philip@personality.co.uk Delete Edit
  7. To answer: "why not have the data formatted out as needed?"...... it's because I find that FMPro's Export produces results that don't behave well when used as HTML, and those 2 search-and-replaces cleans everything up nicely. As regards the structure, the numbered fields are needed because I need the Exported textfiles to match my website's requirements for the files it uses. Each time I need to update the contents of my site (a PHP static ecommerce site) I do an Export from the FMPro database [in which I keep track of price changes and new/changed products] and then FTP the complete folder to my webserver, rename it, and all the pages of my website get updated immediately with all my changed details, prices, etc, because each page is set to "get" a textfile named the same as the product code. A more automated approach to generating the website would not work, as the products I sell are not under my control (it is a service of printing leaflets, books, etc for which I have to use a different supplier for each one, and so prices/sizes/quantities/specifications/speed-of-delivery vary wildly from product to product). Therefore my home-grown FMPro database is just good enough to do the job!! I really appreciate your help. Both you and "comment". Many thanks, Philip Caplan
  8. Thanks Ocean West. I tried it and it looks like it works perfectly! Yay! I will do some full testing, but if the first ".txt" file I tried works perfectly when uploaded to my website, I am hopeful they all will!! But before I can do a full test, each file needs to have 2 search-and-replaces done, and preferably the extension ".txt" removed. I am using BBEdit to handle my text files, and I found that I can use its "Scripting" capabilities to create and run an Applescript. By "recording" my actions I got the following Applescript: tell application "BBEdit" activate open find window replace "§§§" using "\\r" searching in text 1 of text document "BC_102.tab" options {search mode:grep, starting at top:true} replace "\\x{0B}" using "" searching in text 1 of text document "BC_102.tab" options {search mode:grep, starting at top:true} save text document 1 end tell The above script works for one [selected] file, but I need it to: (1) perform as above on EVERY file in a selected folder; (2) "save as" with file-extension removed, then delete the original file. So, are you also able to help me in doing this with Applescript?? I thought I'd ask before looking anywhere else, just in case!! Don't worry if it's not your thing! You've been very helpful to me, and I am most grateful. I said ".txt" file but of course I meant ".tab" file. I think FMPro might always Export UTF-8 files with a ".tab" extension, whatever you tell it to do......
  9. Here's the whole database. I got nuthing to hide!!! Reliaprint1.fmp12.zip
  10. Hold it!! First the good news, I realized (by turning "dialog on" in the Export script step) that the Field Export Order that was to be exported was missing!! So, I edited the script to add it, and the Export worked. Now the bad news: the file that is created is not of use, because it's content is different from the file that would be created by doing a "manual" Export. A "manual" Export makes a file with all the contents of the Field included, one after the other, so the file contains all the Field contents for every Record in the Found set. The "scripted" Export makes a file containing Field contents for a different SearchKey!!!! Help, please.
  11. Wait -- the "LH_101" I have just answered about (26K chars) is the content of one of the text-files which are to be saved in (exported to) "OUTPUT", and named "LH_101.tab" or "LH_101.txt" (it doesn't matter which). Or are you are asking about one of the 100 or so possible values of the field "SearchKey". They could be LH_101, LH_102, CS_101, CS_204, etc. But there is no return-separated list. If it helps I could make (by hand) such a text-file containing a return-separated list of all the possible values of "SearchKey", and that file could be called "value-list.txt". Does that help?
  12. No. It's a text file of about 26000 characters. It is HTML and other text.
  13. Is it worth adding a line (for debugging purposes) which displays the value of $list to help debug what is going on?? If yes, what would be and where could it go?? And perhaps the same for $file
  14. I am still getting no file written into OUTPUT folder. Shouldn't "Set Error Capture [On]" cause an error message if a variable isn't set or a Search fails? Also, I have tried changing the new Line 9 as attached, hoping that would set $list to LH_101 (which is definitely one of the values in the field) in order to see if that worked, but it still didn't work. ================================================================= =============================================
  15. 2000 records, but maybe 100 unique SearchKey values. Some of them will have only a few records, some of them 30 or more. I tried copying the ExecuteSQL from your reply, but it doesn't seem to work. So should I try typing it in by hand as a replacement Line 7??
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.