function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
anil Kumaranil Kumar 

Pipe delimiter text file parsing

Hi All,

I want to parse pipe delimiter .txt file in apex class and save the data into custum objects. Pipe delimitertext file i am getting from other application. Below is sample file. Please help to parse this file.

|BILLDATA|RCB|3517|SUM|11022017|61113
RecordType|ReferenceNumber|OtherData|dtStatement|dtDue|BillerInvoiceNo|NameFirst|MiddleName|NameLast|CompanyName|Address|Address2|City|State|Zip|Phone|Fax

Thanks,
Anil Kumar 
Aslam ChaudharyAslam Chaudhary
Use simple string split funtion.
 
list<string> Values = yourstring.split('|');