I want to Split Text file header then how i do it
This is my code
Text file header come like this i want split like
InvoiceNumber
BillingDate
ShipDateSalesOfficeNumber
.
.
.
sorry i can’t share
@Yogita_Gaikwad In that text file, do you have only headers? If you have only headers, I could see space in between each header you can use “String.Split(” “C)” and have the values as a array
How about this expression
yourString.Split(Environment.NewLine.ToCharArray).AsEnumerable().Where(Function(x) Not String.IsNullOrEmpty(x.ToString.Trim)).ToArray()
Or
yourString.Split(Environment.NewLine.ToArray, StringSplitOptions.RemoveEmptyEntries)
Regards
Gokul
sam.txt (343 Bytes)
this is my text file can u split this like
InvoiceNumber
BillingDate
ShipDate
.
.
hi @Yogita_Gaikwad,
You can create a List(Of String) type variable and then initialize it. Then after that you can split the string by using “yourString.Split(vbTab.ToCharArray).ToList”
I also attached my code here for your reference
StringSplit.zip (2.4 KB)
If this does helped you, kindly mark it as Solved to help others as well. Thanks.
Kind regards,
Kenneth
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.