Parse CSV Comma Delimited File with Quotes and Embedded Comma

Author
Messages
agersh
Veteran Member
Posts: 81
Veteran Member

    Using the Data Iterator node I've been trying to figure out how I can parse the following CSV file/row, Comma Delimited with Quotes and Embedded Comma.

    "1375","Annual","GRETA","GOLD","082189","Yes","REGINA","BRONZ","01/21/2014","BRONZ, REGINA;FRANKEN, JANET","TRANSCRIPTIONIST PATHOLOGY","12354","Yes","No","Yes","","","Submitted to HR","","","","2.03","01/21/2014","01/21/2014","0.00","0.00","0.00","","","01/21/2014"

    Has anyone else come across this situation?

     
    Kyle Jorgensen
    Veteran Member
    Posts: 122
    Veteran Member
      I've haven't tried this, but can you make the delimter character more than 1 character. If so, make the delimiter quote-comman-quote: ","

      Then you'd just have to trim off the leading and trailing quotes on the line.
      BarbR
      Veteran Member
      Posts: 306
      Veteran Member
        I haven't had the situation, but I guess the first thing I'd try is using "," as my delimiter string in the second Data Iterator node. Then in the assign of my first variable I'd always substring to start with position 2 to skip the starting " and my last variable to drop the trailing ".
        Kyle Jorgensen
        Veteran Member
        Posts: 122
        Veteran Member
          yep, just tried it and it works. play with it some. i had to trim the leading quote, but not the trailing quote on the line.
          John Henley
          Senior Member
          Posts: 3348
          Senior Member
            https://www.lawsonguru.co...ith-embedded-commas/
            Thanks for using the LawsonGuru.com forums!
            John
            GeoffTSJY
            Basic Member
            Posts: 16
            Basic Member
              Easy way to do this is just use the javascript library. There is a String function called split. You tell it what character to split by and the result is an array.

              Here is my code:

              //read in all of your data to a single variable. Since I did this literally and not from a file I had to escape all of the quotes with / so they wouldn't be confused at actual quotes of the string definition.
              t1 = "\"1375\",\"Annual\",\"GRETA\",\"GOLD\",\"082189\",\"Yes\",\"REGINA\",\"BRONZ\",\"01/21/2014\",\"BRONZ, REGINA;FRANKEN, JANET\",\"TRANSCRIPTIONIST PATHOLOGY\",\"12354\",\"Yes\",\"No\",\"Yes\",\"\",\"\",\"Submitted to HR\",\"\",\"\",\"\",\"2.03\",\"01/21/2014\",\"01/21/2014\",\"0.00\",\"0.00\",\"0.00\",\"\",\"\",\"01/21/2014\"";

              //I made an array type in the start node
              myArr = t1.split(","); //this tells it to split the string t1 into an array by separating from each comma.

              //The array is returned and stored in myArr because of the assignment "="
              //to show you that I got them all
              t2 = myArr.length

              //to show you a sample of how one of them is stored in the array variable
              //this is the first item in the array
              //t3 = myArr[0]

              //another item. this is the 2nd item. The 32nd item would be myArr[31]
              t4 = myArr[1] 

              Here is my results:
              Activity completed: Start
              Activity started: Assign4770 (Run Id: 4)
              t1 = "1375","Annual","GRETA","GOLD","082189","Yes","REGINA","BRONZ","01/21/2014","BRONZ, REGINA;FRANKEN, JANET","TRANSCRIPTIONIST PATHOLOGY","12354","Yes","No","Yes","","","Submitted to HR","","","","2.03","01/21/2014","01/21/2014","0.00","0.00","0.00","","","01/21/2014"

              myArr = "1375","Annual","GRETA","GOLD","082189","Yes","REGINA","BRONZ","01/21/2014","BRONZ, REGINA;FRANKEN, JANET","TRANSCRIPTIONIST PATHOLOGY","12354","Yes","No","Yes","","","Submitted to HR","","","","2.03","01/21/2014","01/21/2014","0.00","0.00","0.00","","","01/21/2014"

              t2 = 32
              t3 = "1375"
              t4 = "Annual"
              Activity completed: Assign4770 

              Then for the DataIterator use a ForEach instead. Set to Array in the general tab under "Select Option".
              Then in the "Array Input" put your array name. I put myArr in for my example. Then connect the for each start directly to the end and you're done. Look at what you get: (I put the first couple in bold to show you where the output is in the log. Just use that variable for whatever you're trying to do between the start and end of the foreach. In my case that variable is "ForEach6390_arrayValue ")

              
              Activity started: ForEach6390  (Run Id: 3)
              ForLoop ForEach6390: Executing
              ForEach6390_arrayValue = "1375"
              ForEach6390_iterationNumber = 1
              ForLoop ForEach6390: Iteration 1
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue = "Annual"
              ForEach6390_iterationNumber = 2
              ForLoop ForEach6390: Iteration 2
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue = "GRETA"
              ForEach6390_iterationNumber = 3
              ForLoop ForEach6390: Iteration 3
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue = "GOLD"
              ForEach6390_iterationNumber = 4
              ForLoop ForEach6390: Iteration 4
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue = "082189"
              ForEach6390_iterationNumber = 5
              ForLoop ForEach6390: Iteration 5
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue = "Yes"
              ForEach6390_iterationNumber = 6
              ForLoop ForEach6390: Iteration 6
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue = "REGINA"
              ForEach6390_iterationNumber = 7
              ForLoop ForEach6390: Iteration 7
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue = "BRONZ"
              ForEach6390_iterationNumber = 8
              ForLoop ForEach6390: Iteration 8
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue = "01/21/2014"
              ForEach6390_iterationNumber = 9
              ForLoop ForEach6390: Iteration 9
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue = "BRONZ
              ForEach6390_iterationNumber = 10
              ForLoop ForEach6390: Iteration 10
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue =  REGINA;FRANKEN
              ForEach6390_iterationNumber = 11
              ForLoop ForEach6390: Iteration 11
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue =  JANET"
              ForEach6390_iterationNumber = 12
              ForLoop ForEach6390: Iteration 12
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue = "TRANSCRIPTIONIST PATHOLOGY"
              ForEach6390_iterationNumber = 13
              ForLoop ForEach6390: Iteration 13
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue = "12354"
              ForEach6390_iterationNumber = 14
              ForLoop ForEach6390: Iteration 14
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue = "Yes"
              ForEach6390_iterationNumber = 15
              ForLoop ForEach6390: Iteration 15
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue = "No"
              ForEach6390_iterationNumber = 16
              ForLoop ForEach6390: Iteration 16
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue = "Yes"
              ForEach6390_iterationNumber = 17
              ForLoop ForEach6390: Iteration 17
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue = ""
              ForEach6390_iterationNumber = 18
              ForLoop ForEach6390: Iteration 18
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue = ""
              ForEach6390_iterationNumber = 19
              ForLoop ForEach6390: Iteration 19
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue = "Submitted to HR"
              ForEach6390_iterationNumber = 20
              ForLoop ForEach6390: Iteration 20
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue = ""
              ForEach6390_iterationNumber = 21
              ForLoop ForEach6390: Iteration 21
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue = ""
              ForEach6390_iterationNumber = 22
              ForLoop ForEach6390: Iteration 22
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue = ""
              ForEach6390_iterationNumber = 23
              ForLoop ForEach6390: Iteration 23
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue = "2.03"
              ForEach6390_iterationNumber = 24
              ForLoop ForEach6390: Iteration 24
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue = "01/21/2014"
              ForEach6390_iterationNumber = 25
              ForLoop ForEach6390: Iteration 25
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue = "01/21/2014"
              ForEach6390_iterationNumber = 26
              ForLoop ForEach6390: Iteration 26
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue = "0.00"
              ForEach6390_iterationNumber = 27
              ForLoop ForEach6390: Iteration 27
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue = "0.00"
              ForEach6390_iterationNumber = 28
              ForLoop ForEach6390: Iteration 28
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue = "0.00"
              ForEach6390_iterationNumber = 29
              ForLoop ForEach6390: Iteration 29
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue = ""
              ForEach6390_iterationNumber = 30
              ForLoop ForEach6390: Iteration 30
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue = ""
              ForEach6390_iterationNumber = 31
              ForLoop ForEach6390: Iteration 31
              Activity started: End-ForEach6390  (Run Id: 0)
              ForEach6390_arrayValue = "01/21/2014"
              ForEach6390_iterationNumber = 32
              ForLoop ForEach6390: Iteration 32
              Activity started: End-ForEach6390  (Run Id: 0)
              Activity started: End-ForEach6390  (Run Id: 0)
              Activity completed: ForEach6390
              
              Peter O
              Veteran Member
              Posts: 69
              Veteran Member

                Pretty good solution if you have strict data guidelines (comma control ). Unfortunately it looks like your solution would break if they used a field that allowed commas.

                 

                Example:

                t1 = "1375","Annual","GRETA","GOLD","082189","Yes","REGINA","BRONZ","01/21/2014","BRONZ, REGINA;FRANKEN, JANET","TRANSCRIPTIONIST, PATHOLOGY","12354","Yes","No","Yes","","","Submitted to HR, other text here.","","","","2.03","01/21/2014","01/21/2014","0.00","0.00","0.00","","","01/21/2014"
                

                I modified the example variable slightly, but it's still valid in a CSV file. The example above, when parsed by splitting on commas, will break data up into unintended columns.

                 

                GeoffTSJY
                Basic Member
                Posts: 16
                Basic Member
                  You can accommodate for this with a regex to replace the csv delimiter with a custom delimiter. Your replacement delimiter should be something that you are confident won't be in your actual data.

                  
                  //if your csv delimiter string doesn't have "," always exactly the same, you can actually do more regex and replace to
                  //make it the same and then do this process. It depends on how reliable your csv formatting is if that is necessary.
                  t1 = t1.replace(/","/g, '%R0Wd3l1m1t3r%'); //replace with your own delimiter
                  t1 = t1.replace(/"/g, ''); //replace the front and back quotes
                  myArr = t1.split('%R0Wd3l1m1t3r%');
                  

                   

                  //here is the output

                  [Activity started: ForEach2890 (Run Id: 1) ForLoop ForEach2890: Executing ForEach2890_arrayValue = 1375 ForEach2890_iterationNumber = 1 ForLoop ForEach2890: Iteration 1 Activity started: End-ForEach2890 (Run Id: 0) ForEach2890_arrayValue = Annual ForEach2890_iterationNumber = 2 ForLoop ForEach2890: Iteration 2 Activity started: End-ForEach2890 (Run Id: 0) ForEach2890_arrayValue = GRETA ForEach2890_iterationNumber = 3 ForLoop ForEach2890: Iteration 3 Activity started: End-ForEach2890 (Run Id: 0) ForEach2890_arrayValue = GOLD ForEach2890_iterationNumber = 4 ForLoop ForEach2890: Iteration 4 Activity started: End-ForEach2890 (Run Id: 0) ForEach2890_arrayValue = 082189 ForEach2890_iterationNumber = 5 ForLoop ForEach2890: Iteration 5 Activity started: End-ForEach2890 (Run Id: 0) ForEach2890_arrayValue = Yes ForEach2890_iterationNumber = 6 ForLoop ForEach2890: Iteration 6 Activity started: End-ForEach2890 (Run Id: 0) ForEach2890_arrayValue = REGINA ForEach2890_iterationNumber = 7 ForLoop ForEach2890: Iteration 7 Activity started: End-ForEach2890 (Run Id: 0) ForEach2890_arrayValue = BRONZ ForEach2890_iterationNumber = 8 ForLoop ForEach2890: Iteration 8 Activity started: End-ForEach2890 (Run Id: 0) ForEach2890_arrayValue = 01/21/2014 ForEach2890_iterationNumber = 9 ForLoop ForEach2890: Iteration 9 Activity started: End-ForEach2890 (Run Id: 0) ForEach2890_arrayValue = BRONZ, REGINA;FRANKEN, JANET ForEach2890_iterationNumber = 10 ForLoop ForEach2890: Iteration 10 Activity started: End-ForEach2890 (Run Id: 0) ForEach2890_arrayValue = TRANSCRIPTIONIST, PATHOLOGY ForEach2890_iterationNumber = 11 ForLoop ForEach2890: Iteration 11 Activity started: End-ForEach2890 (Run Id: 0) ForEach2890_arrayValue = 12354 ForEach2890_iterationNumber = 12 ForLoop ForEach2890: Iteration 12 Activity started: End-ForEach2890 (Run Id: 0) ForEach2890_arrayValue = Yes ForEach2890_iterationNumber = 13 ForLoop ForEach2890: Iteration 13 Activity started: End-ForEach2890 (Run Id: 0) ForEach2890_arrayValue = No ForEach2890_iterationNumber = 14 ForLoop ForEach2890: Iteration 14 Activity started: End-ForEach2890 (Run Id: 0) ForEach2890_arrayValue = Yes ForEach2890_iterationNumber = 15 ForLoop ForEach2890: Iteration 15 Activity started: End-ForEach2890 (Run Id: 0) ForEach2890_arrayValue = ForEach2890_iterationNumber = 16 ForLoop ForEach2890: Iteration 16 Activity started: End-ForEach2890 (Run Id: 0) ForEach2890_arrayValue = ForEach2890_iterationNumber = 17 ForLoop ForEach2890: Iteration 17 Activity started: End-ForEach2890 (Run Id: 0) ForEach2890_arrayValue = Submitted to HR, other text here. ForEach2890_iterationNumber = 18 ForLoop ForEach2890: Iteration 18 Activity started: End-ForEach2890 (Run Id: 0) ForEach2890_arrayValue = ForEach2890_iterationNumber = 19 ForLoop ForEach2890: Iteration 19 Activity started: End-ForEach2890 (Run Id: 0) ForEach2890_arrayValue = ForEach2890_iterationNumber = 20 ForLoop ForEach2890: Iteration 20 Activity started: End-ForEach2890 (Run Id: 0) ForEach2890_arrayValue = ForEach2890_iterationNumber = 21 ForLoop ForEach2890: Iteration 21 Activity started: End-ForEach2890 (Run Id: 0) ForEach2890_arrayValue = 2.03 ForEach2890_iterationNumber = 22 ForLoop ForEach2890: Iteration 22 Activity started: End-ForEach2890 (Run Id: 0) ForEach2890_arrayValue = 01/21/2014 ForEach2890_iterationNumber = 23 ForLoop ForEach2890: Iteration 23 Activity started: End-ForEach2890 (Run Id: 0) ForEach2890_arrayValue = 01/21/2014 ForEach2890_iterationNumber = 24 ForLoop ForEach2890: Iteration 24 Activity started: End-ForEach2890 (Run Id: 0) ForEach2890_arrayValue = 0.00 ForEach2890_iterationNumber = 25 ForLoop ForEach2890: Iteration 25 Activity started: End-ForEach2890 (Run Id: 0) ForEach2890_arrayValue = 0.00 ForEach2890_iterationNumber = 26 ForLoop ForEach2890: Iteration 26 Activity started: End-ForEach2890 (Run Id: 0) ForEach2890_arrayValue = 0.00 ForEach2890_iterationNumber = 27 ForLoop ForEach2890: Iteration 27 Activity started: End-ForEach2890 (Run Id: 0) ForEach2890_arrayValue = ForEach2890_iterationNumber = 28 ForLoop ForEach2890: Iteration 28 Activity started: End-ForEach2890 (Run Id: 0) ForEach2890_arrayValue = ForEach2890_iterationNumber = 29 ForLoop ForEach2890: Iteration 29 Activity started: End-ForEach2890 (Run Id: 0) ForEach2890_arrayValue = 01/21/2014 ForEach2890_iterationNumber = 30 ForLoop ForEach2890: Iteration 30 Activity started: End-ForEach2890 (Run Id: 0) Activity started: End-ForEach2890 (Run Id: 0) Activity completed: ForEach2890

                  GeoffTSJY
                  Basic Member
                  Posts: 16
                  Basic Member
                    I should note that in my first solution, there was also a problem that the quotes were actually part of the data. Using replace and/or just a different split argument could take care of that.

                    Now you could also read in all of your data in at once into an array. Then make each item in that array be an array. This is called a multidimensional array. If you were to draw it out, you'd have a table, just like in excel spreadsheets. Really all CSVs are are multidimensional arrays.

                    Now do a foreach node inside of a foreach node. The outer foreach will be set to array and input will be rowArr.

                    The inner foreach node will be set to array and input will be <!--rowArr[ForEach2890_iterationNumber -1]-->

                    Where ForEach2890 is the outer foreach node. You have to do -1 on the iteration number because lawson counts the first record as 1 but in computer science the first number is always 0. So -1 makes those the same.

                    You'll notice in my output. The outer 2890 runs start iteration 1 and then goes through all of that row. Then goes to iteration 2 and then does all of the 2nd row. BTW, the first row was the original data and the 2nd row is the data modded by Peter.

                    
                    //rowArr is just an array I made empty in the start node
                    //first split the entire dataset by the newline character.
                    //each item in this array is an entire row of data
                    rowArr = t1.split('\n');
                    //now go row by row
                    for each (var i in rowArr) {
                    var tmp = new String(rowArr); //put the row in a temp string
                    tmp = tmp.replace(/","/g, '%R0Wd3l1m1t3r%'); //fix delimiter
                    tmp = tmp.replace(/"/g, ''); //fix delimiter #2
                    rowArr = tmp.split('%R0Wd3l1m1t3r%'); //split by our delimiter
                    } //go on to the next row
                    //here is the output
                    Activity started: ForEach2890  (Run Id: 3)
                    ForLoop ForEach2890: Executing
                    ForEach2890_arrayValue = "1375","Annual","GRETA","GOLD","082189","Yes","REGINA","BRONZ","01/21/2014","BRONZ, REGINA;FRANKEN, JANET","TRANSCRIPTIONIST, PATHOLOGY","12354","Yes","No","Yes","","","Submitted to HR, other text here.","","","","2.03","01/21/2014","01/21/2014","0.00","0.00","0.00","","","01/21/2014"
                    ForEach2890_iterationNumber = 1
                    ForLoop ForEach2890: Iteration 1
                    Activity started: ForEach5270  (Run Id: 4)
                    ForLoop ForEach5270: Executing
                    ForEach5270_arrayValue = "1375"
                    ForEach5270_iterationNumber = 1
                    ForLoop ForEach5270: Iteration 1
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "Annual"
                    ForEach5270_iterationNumber = 2
                    ForLoop ForEach5270: Iteration 2
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "GRETA"
                    ForEach5270_iterationNumber = 3
                    ForLoop ForEach5270: Iteration 3
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "GOLD"
                    ForEach5270_iterationNumber = 4
                    ForLoop ForEach5270: Iteration 4
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "082189"
                    ForEach5270_iterationNumber = 5
                    ForLoop ForEach5270: Iteration 5
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "Yes"
                    ForEach5270_iterationNumber = 6
                    ForLoop ForEach5270: Iteration 6
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "REGINA"
                    ForEach5270_iterationNumber = 7
                    ForLoop ForEach5270: Iteration 7
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "BRONZ"
                    ForEach5270_iterationNumber = 8
                    ForLoop ForEach5270: Iteration 8
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "01/21/2014"
                    ForEach5270_iterationNumber = 9
                    ForLoop ForEach5270: Iteration 9
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "BRONZ
                    ForEach5270_iterationNumber = 10
                    ForLoop ForEach5270: Iteration 10
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue =  REGINA;FRANKEN
                    ForEach5270_iterationNumber = 11
                    ForLoop ForEach5270: Iteration 11
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue =  JANET"
                    ForEach5270_iterationNumber = 12
                    ForLoop ForEach5270: Iteration 12
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "TRANSCRIPTIONIST
                    ForEach5270_iterationNumber = 13
                    ForLoop ForEach5270: Iteration 13
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue =  PATHOLOGY"
                    ForEach5270_iterationNumber = 14
                    ForLoop ForEach5270: Iteration 14
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "12354"
                    ForEach5270_iterationNumber = 15
                    ForLoop ForEach5270: Iteration 15
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "Yes"
                    ForEach5270_iterationNumber = 16
                    ForLoop ForEach5270: Iteration 16
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "No"
                    ForEach5270_iterationNumber = 17
                    ForLoop ForEach5270: Iteration 17
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "Yes"
                    ForEach5270_iterationNumber = 18
                    ForLoop ForEach5270: Iteration 18
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = ""
                    ForEach5270_iterationNumber = 19
                    ForLoop ForEach5270: Iteration 19
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = ""
                    ForEach5270_iterationNumber = 20
                    ForLoop ForEach5270: Iteration 20
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "Submitted to HR
                    ForEach5270_iterationNumber = 21
                    ForLoop ForEach5270: Iteration 21
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue =  other text here."
                    ForEach5270_iterationNumber = 22
                    ForLoop ForEach5270: Iteration 22
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = ""
                    ForEach5270_iterationNumber = 23
                    ForLoop ForEach5270: Iteration 23
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = ""
                    ForEach5270_iterationNumber = 24
                    ForLoop ForEach5270: Iteration 24
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = ""
                    ForEach5270_iterationNumber = 25
                    ForLoop ForEach5270: Iteration 25
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "2.03"
                    ForEach5270_iterationNumber = 26
                    ForLoop ForEach5270: Iteration 26
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "01/21/2014"
                    ForEach5270_iterationNumber = 27
                    ForLoop ForEach5270: Iteration 27
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "01/21/2014"
                    ForEach5270_iterationNumber = 28
                    ForLoop ForEach5270: Iteration 28
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "0.00"
                    ForEach5270_iterationNumber = 29
                    ForLoop ForEach5270: Iteration 29
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "0.00"
                    ForEach5270_iterationNumber = 30
                    ForLoop ForEach5270: Iteration 30
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "0.00"
                    ForEach5270_iterationNumber = 31
                    ForLoop ForEach5270: Iteration 31
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = ""
                    ForEach5270_iterationNumber = 32
                    ForLoop ForEach5270: Iteration 32
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = ""
                    ForEach5270_iterationNumber = 33
                    ForLoop ForEach5270: Iteration 33
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "01/21/2014"
                    ForEach5270_iterationNumber = 34
                    ForLoop ForEach5270: Iteration 34
                    Activity started: End-ForEach5270  (Run Id: 0)
                    Activity started: End-ForEach5270  (Run Id: 0)
                    Activity completed: ForEach5270
                    Activity started: End-ForEach2890  (Run Id: 0)
                    ForEach2890_arrayValue = "1375","Annual","GRETA","GOLD","082189","Yes","REGINA","BRONZ","01/21/2014","BRONZ, REGINA;FRANKEN, JANET","TRANSCRIPTIONIST PATHOLOGY","12354","Yes","No","Yes","","","Submitted to HR","","","","2.03","01/21/2014","01/21/2014","0.00","0.00","0.00","","","01/21/2014"
                    ForEach2890_iterationNumber = 2
                    ForLoop ForEach2890: Iteration 2
                    Activity started: ForEach5270  (Run Id: 5)
                    ForLoop ForEach5270: Executing
                    ForEach5270_arrayValue = "1375"
                    ForEach5270_iterationNumber = 1
                    ForLoop ForEach5270: Iteration 1
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "Annual"
                    ForEach5270_iterationNumber = 2
                    ForLoop ForEach5270: Iteration 2
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "GRETA"
                    ForEach5270_iterationNumber = 3
                    ForLoop ForEach5270: Iteration 3
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "GOLD"
                    ForEach5270_iterationNumber = 4
                    ForLoop ForEach5270: Iteration 4
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "082189"
                    ForEach5270_iterationNumber = 5
                    ForLoop ForEach5270: Iteration 5
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "Yes"
                    ForEach5270_iterationNumber = 6
                    ForLoop ForEach5270: Iteration 6
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "REGINA"
                    ForEach5270_iterationNumber = 7
                    ForLoop ForEach5270: Iteration 7
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "BRONZ"
                    ForEach5270_iterationNumber = 8
                    ForLoop ForEach5270: Iteration 8
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "01/21/2014"
                    ForEach5270_iterationNumber = 9
                    ForLoop ForEach5270: Iteration 9
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "BRONZ
                    ForEach5270_iterationNumber = 10
                    ForLoop ForEach5270: Iteration 10
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue =  REGINA;FRANKEN
                    ForEach5270_iterationNumber = 11
                    ForLoop ForEach5270: Iteration 11
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue =  JANET"
                    ForEach5270_iterationNumber = 12
                    ForLoop ForEach5270: Iteration 12
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "TRANSCRIPTIONIST PATHOLOGY"
                    ForEach5270_iterationNumber = 13
                    ForLoop ForEach5270: Iteration 13
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "12354"
                    ForEach5270_iterationNumber = 14
                    ForLoop ForEach5270: Iteration 14
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "Yes"
                    ForEach5270_iterationNumber = 15
                    ForLoop ForEach5270: Iteration 15
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "No"
                    ForEach5270_iterationNumber = 16
                    ForLoop ForEach5270: Iteration 16
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "Yes"
                    ForEach5270_iterationNumber = 17
                    ForLoop ForEach5270: Iteration 17
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = ""
                    ForEach5270_iterationNumber = 18
                    ForLoop ForEach5270: Iteration 18
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = ""
                    ForEach5270_iterationNumber = 19
                    ForLoop ForEach5270: Iteration 19
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "Submitted to HR"
                    ForEach5270_iterationNumber = 20
                    ForLoop ForEach5270: Iteration 20
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = ""
                    ForEach5270_iterationNumber = 21
                    ForLoop ForEach5270: Iteration 21
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = ""
                    ForEach5270_iterationNumber = 22
                    ForLoop ForEach5270: Iteration 22
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = ""
                    ForEach5270_iterationNumber = 23
                    ForLoop ForEach5270: Iteration 23
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "2.03"
                    ForEach5270_iterationNumber = 24
                    ForLoop ForEach5270: Iteration 24
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "01/21/2014"
                    ForEach5270_iterationNumber = 25
                    ForLoop ForEach5270: Iteration 25
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "01/21/2014"
                    ForEach5270_iterationNumber = 26
                    ForLoop ForEach5270: Iteration 26
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "0.00"
                    ForEach5270_iterationNumber = 27
                    ForLoop ForEach5270: Iteration 27
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "0.00"
                    ForEach5270_iterationNumber = 28
                    ForLoop ForEach5270: Iteration 28
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "0.00"
                    ForEach5270_iterationNumber = 29
                    ForLoop ForEach5270: Iteration 29
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = ""
                    ForEach5270_iterationNumber = 30
                    ForLoop ForEach5270: Iteration 30
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = ""
                    ForEach5270_iterationNumber = 31
                    ForLoop ForEach5270: Iteration 31
                    Activity started: End-ForEach5270  (Run Id: 0)
                    ForEach5270_arrayValue = "01/21/2014"
                    ForEach5270_iterationNumber = 32
                    ForLoop ForEach5270: Iteration 32
                    Activity started: End-ForEach5270  (Run Id: 0)
                    Activity started: End-ForEach5270  (Run Id: 0)
                    Activity completed: ForEach5270
                    Activity started: End-ForEach2890  (Run Id: 0)
                    ForEach2890_arrayValue =
                    ForEach2890_iterationNumber = 3
                    ForLoop ForEach2890: Iteration 3
                    Activity started: ForEach5270  (Run Id: 6)
                    ForLoop ForEach5270: Executing
                    ForEach5270_arrayValue =
                    ForEach5270_iterationNumber = 1
                    ForLoop ForEach5270: Iteration 1
                    Activity started: End-ForEach5270  (Run Id: 0)
                    Activity started: End-ForEach5270  (Run Id: 0)
                    Activity completed: ForEach5270
                    Activity started: End-ForEach2890  (Run Id: 0)
                    Activity started: End-ForEach2890  (Run Id: 0)
                    Activity completed: ForEach2890
                    
                    GeoffTSJY
                    Basic Member
                    Posts: 16
                    Basic Member
                      Bah, this last one screwed up. Sorry, I don't have time to fix it right now. Hopefully you get the idea. This is part of the process though. I should only need to do a regex to make sure my input string is consistently formatted before my parsing. That shouldn't be hard to do. Maybe I'll update this later. But I have to get back to other stuff. Sorry!
                      ---