my input text file format
SHIPPER/EXPORTER (2) DOCUMENT NO (5)
EXXON MOBIL CORPORATION NAM2998573 NAM2998573
22777 SPRINGWOODS VILLAGE PARKWAY EXPORT REFERENCES (6)
SPRING, TX 77389-1425 USA 5004753 / 6004754
4451690406
CONSIGNEE (3) FORWARDING AGENT - REFERENCES (7)
MANULI DA AMAZONIA E LOGISTICS INC (931839)
INDUSTRIA DE EMBALAGENS LTDA AV. 3050 POST OAK BLVD, STE 444 CHB:
BURITI 3670 BAIRRO DISTRITO HOUSTON, TX 77056 FMC: 025823
INDUSTRIAL 69075-000 MANAUS, AM TEL. NO. 346-802-4008
BRASIL
CNPJ/CPF: 14269557000137
NOTIFY (4) POINT AND COUNTRY OF ORIGIN (8)
MANULI DA AMAZONIA
INDUSTRIA DE EMBALAGENS LTDA AV. UNITED STATES
BURITI 3670 BAIRRO DISTRITO DOMESTIC ROUTING/EXPORT INSTRUCTIONS (9)
INDUSTRIAL 69075-000 MANAUS, A NO SED REQUIRED - X20180206869589
BRASIL CNPJ: 14.269.557/0001-37
Note: i want to read and extract first Shipper/Exporter sub-string values.
in my program code when i am reading shipper exporter values its reading document no and export reference values also.
so here when i am reading shipper exporter header name and values i want to skip document no and export reference header name and values
so please kindly give me a solution for this
i want to show my output like in this format
SHIPPER/EXPORTER (2)
EXXON MOBIL CORPORATION
22777 SPRINGWOODS VILLAGE PARKWAY
SPRING, TX 77389-1425 USA
What I have tried:
<pre>
static void Main(string[] args)
{
string text = System.IO.File.ReadAllText(@"D:\data.txt");
int i = text.IndexOf("Shipper/Exopter");
string shipperexpoter = text.Substring(i+15,80);
System.IO.File.WriteAllText(@"D:\output.txt", "Shipper/Exopter="+shipperexpoter);
Console.WriteLine("Shipper/Expoter =" +shipperexpoter);
Console.Read();