Workflow Soluiton

 View Only
  • 1.  String parsing

    Posted Sep 17, 2008 08:24 AM
    First off, I am new to Workflow. I have used it to make a few projects, but I don't have a grasp of all of the components. I have been looking through the components I can find that involve string parsing, and so far I have been disappointed. All I want to do is search through a string, find certain patterns, and then grab the text that comes after each pattern. Any tips on how to do this?


  • 2.  RE: String parsing

    Posted Sep 17, 2008 09:35 AM
    So here is what I am doing for this problem: 1. I'm using the 'Index of Text Within Text' component multiple times to find the indexes of the different patterns that are acting as delimiters (i.e. "0_name:", "1_address:", "2_city:", etc.). 2. Then I am using 'Extract Text From Text' to get the substrings that I need. It requires a little bit of work to figure out the substring locations, and it is not very flexible, but I think it will work.


  • 3.  RE: String parsing

    Posted Sep 18, 2008 07:36 AM
    Hi FreEner-g_Wes, 2 things. 1. You're right. Finding the index of the beginning in one component, the end in another component, and getting the substring in the next component is a bit of work just to extract some text from within a string. WFS is designed to be very granular keeping components very focused so there aren't a lot of components that do something 'and' something else unless it's a great big workflow component. I think you have a good point about the substring by pattern being overly granular though and we'll look at adding a couple more advanced string handling components in the next release. 2. There are 'regular expression' components which might make it easier to find the patterns you're lookiing for. They tend to be a lot more flexible than simply 'text within text' I'm not sure how sophisticated the test is that you're parsing, but that's a thing to try. Lastly.... The component development API is very straightforward so you have a pattern you'll be doing over and over (like extracting text from text by pattern) you might want to consider crafting your own component for use in the tool