February 17, 201214 yr Ok, here is my problem, I'm hoping it's not impossible: I have a bunch of TXT files, which have HTML code in them. Each file has the same layout and stucture, but with the Customer Name & Address and Product Name & Desciption being different on each page. I want to strip all the other info from all the text, and end up with only 2 fields, Customer Name & Address and Product Name & Description left. Is that possible? Thanks guys, really appreciate the help!
February 17, 201214 yr It's probably possible, but we don't have enough details. Are you able to import the files so that each ends up in a record of its own?
February 19, 201214 yr Author Comment, thank you for the reply, if anyone can help me, you can! Here is the file in HTM format, or you can view it in notepad. I greatly appreciate any and all help. example.htm
February 19, 201214 yr You haven't answered my question. I see two issues here: (1) how to import the file contents into a field; and (2) how to parse out the information you want. The second issue may be tedious, but other than that it should be easy - assuming the code is the same for all. However, the first issue is not as easy: your file's extension is .htm and Filemaker doesn't see it as a "text file" when importing a folder. Unless you are willing to insert each file individually, you will need an OS-level script or a plugin. Isn't there a way to get your data provider to switch to a more friendly format?
February 23, 201214 yr Author Bear with me, I'm no expert.... I know they are HTM, and I can't do anything but convert them all to TXT files. I can import all the records, and end up with a bunch of 1 field records with all the text in the field. Once I get them in there, I was hoping there would be an easy way to extract the actual data I need. I tried Find/Replace, to basically delete all the common text and end up with just the data I need, but I only got as far as trying to delete the " and I'm not sure how to say I actually want to delete the ", and that I'm not trying to use it in a function format.....
February 23, 201214 yr I can import all the records, and end up with a bunch of 1 field records with all the text in the field. That's good. See if you can proceed with the attached. Receipts.zip
February 26, 201213 yr Author When I tried an open it it shows empty and says Invalid. When I try to open the zip file that is... Am I doing something wrong on my end? Thank you.
February 26, 201213 yr That is bizarre. It works fine for me just now. I'm Windows XP. I see nothing unusual in the zipped file nor the FM file.
February 26, 201213 yr Author I'm using Windows 7, when I open it it's blank, and when I hit extract all it says "Windows cannot complete the extraction. The Compressed (zipped) Folder 'C:UsersJonathanDownloadsReceipts.zip' is invalid." Anyway you can send me just the FM file LaRetta?
February 26, 201213 yr I am happy to try and the tester in me can't resist attempting to figure this out. So here is Receipts.zip which is my unzipped fp7 file zipped again (and the file opens fine). I have also attached ReceiptsORIG.zip which is my attaching Michael's original zip back (just to see if it is site related but I doubt it). Oh, but no, I can't send it as fp7 ... limits of this site. Receipts.zip ReceiptsORIG.zip
February 26, 201213 yr As an aside, it seems that you may run into this again ... Windows 7 has a but bug unzipping in some situations (one being unzipping if zipped on a Mac). Here is link for you: http://fmforums.com/...__fromsearch__1 UPDATE: corrected typo ... Windows 7 might have a but as well but I meant to say bug, LOL.
February 26, 201213 yr Author Thanks LaRetta, I had a hunch that might have been the issue... I will have to check into it.
February 26, 201213 yr Author That's good. See if you can proceed with the attached. Ok, so if I copy and paste the text into the field one by one it works great, but when I import all the records as a folder, the fields state ***not found***. I'm assuming I'm importing the records wrong? I'm not sure...
February 27, 201213 yr It means that the string defined as prefix in the calculation was not found in the imported text. Perhaps it's only a difference in the way carriage returns are encoded.
February 27, 201213 yr Author Ya because if I copy and paste the text from a file, and import the same file, it only works on the copied and pasted file. I'm going to see if I can remove all carriage returns from all the files using notepad++ and see if that resolves it...
February 27, 201213 yr Author Got it! Thanks a ton, you saved me a great deal of time, I really apprecaite you help!
Create an account or sign in to comment