I have a string like
String OrderText = @"1 MI-SCBSMT24SM 10 45.62 1 PC 456.20 2020.03.18
MI-SCBSMT24SM,, MI-SCBSMT24SM
2 MI-SCBSML24SM 10 32.28 1 PC 322.80 2020.03.18
MI-SCBSML24SM,, MI-SCBSML24SM"
Here one order is 1 MI-SCBSMT24SM 10 45.62 1 PC 456.20 2020.03.18 MI-SCBSMT24SM,, MI-SCBSMT24SM
And second order is
2 MI-SCBSML24SM 10 32.28 1 PC 322.80 2020.03.18 MI-SCBSML24SM,, MI-SCBSML24SM
It can be consist of 3 rows
what i wanted to do split by each of order
my output will be like
- orderRow.ArticleCode = OrderItem[1];
- orderRow.Quantity = Convert.ToInt32(OrderItem[2]);
- orderRow.Price = OrderItem[3];
- orderRow.Amount = OrderItem[6];
- orderRow.DeliveryDate = OrderItem[7].Replace(".", "-");
and for second orderrow
- orderRow.ArticleCode = OrderItem[1];
- orderRow.Quantity = Convert.ToInt32(OrderItem[2]);
- orderRow.Price = OrderItem[3];
- orderRow.Amount = OrderItem[6];
- orderRow.DeliveryDate = OrderItem[7].Replace(".", "-");
3rd row i mean that there can be another row like below way
3 MI-SCBSML24SM 10 32.28 1 PC 322.80 2020.03.18
MI-SCBSML24SM,, MI-SCBSML24SM
we have to do the same
- orderRow.ArticleCode = OrderItem[1];
- orderRow.Quantity = Convert.ToInt32(OrderItem[2]);
- orderRow.Price = OrderItem[3];
- orderRow.Amount = OrderItem[6];
- orderRow.DeliveryDate = OrderItem[7].Replace(".", "-");