Using multiple steps I am able to extract several "Truck Numbers" from the email (see attached image). It saves them as individual lines in a text file or Excel. I would like to merge the results into one cell to post in Excel. Using Filtering and Replace it appears that the lines merged when I selected "Remove all break lines in Truck Number". But when I run the process it stills posts to individual lines. I am hoping I am wrong but will this require a script to perform the merge? I am currently trialing EmailParser 

Hi Steve,
You can find an example on how to merge fields values:
https://www.emailparser.com/b/merge-multiple-field-values-one
It uses some C# scripting but the script is so simple that, even if you don't know programming, you can figure out how to adapt it to your configuration.
However, feel free to post a message again if you have questions.
You can find an example on how to merge fields values:
https://www.emailparser.com/b/merge-multiple-field-values-one
It uses some C# scripting but the script is so simple that, even if you don't know programming, you can figure out how to adapt it to your configuration.
However, feel free to post a message again if you have questions.
Thank You for the quick reply. I read the article but unfortunately my situation is a bit different. The email I am parsing is a completion ticker from a technician. It has (1) PO Number (1) Date and (1-10) trucks. What happens (see attached Image) is it posts the Date and PO once along with Truck (1) on line 1, which is perfect. The remaining trucks are posted next on individual lines with blank PO and Date fields. In order to correct this I was hoping to merge the trucks so that everything is on one line. As I mentioned previously when I check the box "Remove all break lines in Truck Number" EmailParser combines the fields in the Testing Area, but it does not post it that way. I was hoping to click my way through to a solution without having to write any script. Thank You
Attachments
Hi Steve,
Is the number of trucks variable? I mean, is it possible that in one email there are 5 trucks and in the next one 6?
Feel free to forward me a couple of sample emails to support@emailparser.com. I will not post them here but I think it may help me to better understand your case.
In order to correct this I was hoping to merge the trucks so that everything is on one line.If you want to have everything on only one row I think it would be possible only for a fixed amount of trucks.
Is the number of trucks variable? I mean, is it possible that in one email there are 5 trucks and in the next one 6?
Feel free to forward me a couple of sample emails to support@emailparser.com. I will not post them here but I think it may help me to better understand your case.
Unfortunately it varies up to a max of 10. I sent you an example email. Thank You
Thanks for the email Steve. Now I understand much better what you are trying to do.
If there is a max of truck numbers that can appear in an email there is a way to do this with a small script (different from the one I gave you in my first reply). It is the following:
It takes the values of the field truck_number which contains a value for each truck in the email and create a different field for each one. With an example is much easier to understand. For instance, it converts:
truck_number FL991
RL1625
PU88
RL1388
RC848
RL1329
RL1612
To:
truck_1_number: FL991
truck_2_number: RL1625
truck_3_number: PU88
truck_4_number: RL1388
truck_5_number: RC848
truck_6_number: RL1329
truck_7_number: RL1612
Then, you can add the truck_1_number, track_2_number, track_3_number in the excel action. I have attached some screenshots for better understanding.
If there is a max of truck numbers that can appear in an email there is a way to do this with a small script (different from the one I gave you in my first reply). It is the following:
using System;
using System.Text;
using System.IO;
using System.Net.Mail;
using System.Collections.Specialized;
using System.Collections.Generic;
using EmailParserBackend.ScriptingInterface;
public class MyAction : ScriptBasedAction
{
public override bool Run(MailMessage email, NameValueCollection fields)
{
List<string> truck_number_list = new List<string>();
foreach(string value in fields.GetValues("truck_number"))
truck_number_list.Add(value);
for(int i=0;i<truck_number_list.Count;i++)
fields.Add("truck_"+(i+1).ToString()+"_number",truck_number_list);
return (true);
}
}
It takes the values of the field truck_number which contains a value for each truck in the email and create a different field for each one. With an example is much easier to understand. For instance, it converts:
truck_number FL991
RL1625
PU88
RL1388
RC848
RL1329
RL1612
To:
truck_1_number: FL991
truck_2_number: RL1625
truck_3_number: PU88
truck_4_number: RL1388
truck_5_number: RC848
truck_6_number: RL1329
truck_7_number: RL1612
Then, you can add the truck_1_number, track_2_number, track_3_number in the excel action. I have attached some screenshots for better understanding.
Thank You. That will work just fine.
Figured it out. Great Product!! Using filtering and multi-parsing I was finally able to extract the data I needed and format it for entry into Excel and SQL. It was all done by point and click using an Action Type= (Loop), no scripting. (See my problem in an earlier post Excel Data.png) I have one "date and location" but 8 trucks, and the date and location fields are blank on the other 7 in Excel .((ACTION Type= Run for each field group (Loop)) By entering the "one value" fields along with the "more than one value" fields into the Action (Loop) it filled in the blank fields of the other 7 trucks with the date and location. All 8 fields also have the same P.O. Number which is how I sort in SQL.
- All times are UTC -
