I’m extracting data from a PDF file and saving it into a String variable but the Input looks like
"Labor and Job Works All Amount in INR S.Hrs Labor Disc/ Taxable CGST SGST IGST Total S# Labor Code Description of Service SAC Code Rate Rate Rate Labor UOM Charges Rebate Value (%) Amount (%) Amount (%) Amount Amount 1 40101NAF Tyre thread depth check all wheels 998714 0.40 160.00 160.00 - 0.00 - 0.00 18.00 28.80 188.80 Hrs 2 332281AF Hub end play adjustment of both wheel 998714 1.00 400.00 400.00 - 0.00 - 0.00 18.00 72.00 472.00 with diagnosis Hrs 3 353415AF Rear axle (2) hub play adjustment 998714 2.00 800.00 800.00 - 0.00 - 0.00 18.00 144.00 944.00 Hrs Door check strap on 1st door as rotary 0.20 4 720214AF door,LH replace (with hinged door 998714 Hrs 80.00 80.00 - 0.00 - 0.00 18.00 14.40 94.40 removed) 5 353411AF Rear axle hub assembly both remove/ 998714 4.50 1,800.00 1,800.00 - 0.00 - 0.00 18.00 324.00 2,124.00 install Hrs Sub Total 3,240.00 3,240.00 0.00 0.00 583.20 3,823.20 "
But I want output in a different format, it’s should be in this format
{
" 1 40101NAF Tyre thread depth check all wheels 998714 0.40 160.00 160.00 - 0.00 - 0.00 18.00 28.80 188.80",
" Hrs",
" 2 332281AF Hub end play adjustment of both wheel 998714 1.00 400.00 400.00 - 0.00 - 0.00 18.00 72.00 472.00",
" with diagnosis Hrs",
" 3 353415AF Rear axle (2) hub play adjustment 998714 2.00 800.00 800.00 - 0.00 - 0.00 18.00 144.00 944.00",
" Hrs",
" Door check strap on 1st door as rotary 0.20",
" 4 720214AF door,LH replace (with hinged door 998714 Hrs 80.00 80.00 - 0.00 - 0.00 18.00 14.40 94.40",
" removed)",
" 5 353411AF Rear axle hub assembly both remove/ 998714 4.50 1,800.00 1,800.00 - 0.00 - 0.00 18.00 324.00 2,124.00",
" install Hrs",
}
and I’m using this expression
System.Text.RegularExpressions.Regex.Matches( read_pdf_file, “(.\s{10}\d{1,}.\n\s{0,}\d{1,3}\s{3,}\w{0,}\d{1,}\s{3,}.\n.)|(\d{1,3}\s{3,}\w{0,}\d{1,}\s{3,}.\n.)”)
read_pdf_file - Input Variable
Please help me to find a solution.

