LaRetta Posted August 24, 2007 Posted August 24, 2007 (edited) I have an import of one text field which is delimited with ~. There are 18 fields to parse from this one field. To make it easy AND to make it simple for future to determine how to modify the calc if necessary, I decided that each calc should be identical but the Developer simply specify the CHUNK NUMBER. Here's what I came up with. I originally used a calculation by Comment. But I could not figure how to adjust it to allow for specification of chunk without modifying the beginning and ending calculations; nor could I adjust it in case there was no beginning chunk. My idea is to add a ~ in front and at end of every field. Then the calculation is identical. Here's the idea (see attached). Please, if anyone has simpler way where the only change is ONE specification, I would love to see it. This is a HUGE, complex import and I want it as lean and mean as possible. Thanks in advance for the ideas!! LaRetta testParse.zip Edited August 24, 2007 by Guest
LaRetta Posted August 24, 2007 Author Posted August 24, 2007 (edited) What I'm trying to say is this ... I'd like to eliminate theField 'padding' of adding tilde before and after but STILL only use one generic calculation with one simple specification, indicating where the chunk to parse resides; having all calcs identical. I see no logic to make that happen without exceptions for beginning and end. Make sense? theParseField is (of course) only for ease of display. The padding happens within each calc itself ... Edited August 24, 2007 by Guest corrected typo
comment Posted August 24, 2007 Posted August 24, 2007 I don't quite understand the problem. With the formula you are using, you can specify a different "chunk" for each calculation field, and the rest of the calc is the same for all. I should point out that the formula was devised to handle a generic situation (extract n-th value, using any n and any separator). If your imported field will not contain any carriage returns, you can simplify to: Let ( n = 1 ; GetValue ( Substitute ( Importedfield ; "~" ; ¶ ) ; n ) )
LaRetta Posted August 24, 2007 Author Posted August 24, 2007 (edited) Ah, and I've seen this before too. Thank you, Michael - it's perfect! Don't you DARE laugh, John... :laugh: Edited August 24, 2007 by Guest
LaRetta Posted August 24, 2007 Author Posted August 24, 2007 (edited) Oh, Michael, I am laughing because John knows I try to learn your work and what you presented (secondly) is also your work (no duh, ha ha) using GetValue(). And we had discussed this very technique of yours just few weeks ago. I should have remembered it all and I knew he'd laugh at me for not remembering - just like I'm laughing at me now. It's one of those forehead-slap moments! IIRC, I had whispered ... "Oh God, I'll NEVER forget this technique. It will save SO MUCH time when parsing." And I had forgotten it. : Edited August 24, 2007 by Guest
LaRetta Posted August 24, 2007 Author Posted August 24, 2007 Oh thank you very much for that ... I'm at work and I laughed so loud thirty people turned around to stare at me. I might not be ABLE to keep my day job. And yes, I'm on my lunch. :jester:
Recommended Posts
This topic is 6361 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