Trouble with regular expression

Hi All
We are trying to extract customers and invoices from txt file
Tried several regular expressions

The “Match pattern module” is the module that identifies the customer.

@Actor[^\n]+\s+“(?[^”])“;”(?[^"])“;”(?[^“])“;”(?[^"])”;“(?[^”])“;”(?[^"])“;”(?[^“])“;”(?[^"])”;“(?[^”])“;”(?[^"])“;”(?[^“])“;”(?[^"])”;“(?[^”])“;”(?[^"])“;”(?[^“])“;”(?[^"])”;“(?[^”])“;”(?[^"])“[\w\W]+@WaBnd[^\n]+\s+”(?[^“])" “(?[^”])” “(?[^”]*)"

Blueprint :

blueprint.json (478.6 KB)

I have a thread for earlier that seemed to do the thrick, but we still struggle with customer.
Maybe due to changes in the solution because of other challenges.

Link to the last thread :

@samliew
Can you please look into this for me ?
I tried to send you a PM, but didn`t succeed :slight_smile:

What’s wrong with the regular expression? Please create a regex101.com demo (ECMAScript selected on the left) with example text, save, and paste the link here.

For more information, see

The Match pattern module enables you to find and extract string elements matching a search pattern from a given text. The search pattern is a regular expression (aka regex or regexp), which is a sequence of characters in which each character is either a metacharacter, having a special meaning, or a regular character that has a literal meaning.

samliewrequest private consultation

Join the unofficial Make Discord server to chat with other makers!

1 Like

Growwstacks say the regex is the problem.
When i test i don`t think this is the case.
I think the problem is that we need to match the invoice numbers to the customer.

In this case invoice 100542 is for customer 10001 and 100543 is for 10349.
How can i make it know that next invoice number is next customer ?
In addition, the first line of each invoice is marked with customer number.
According to Growwstacks this is not possible, but i find that hard to believe.
If you check the blueprint, you can see that they have rearranged the modules you made for me last time. Can this be part of the issue?

EX :

@IMPORT_METHOD(1)

@Actor (=CustNo,SupNo,Nm,Ad1,Ad2,Ad3,PNo,PArea,Phone,Fax,MailAd,BsNo,BGiro,Ctry,Lang,Cur,CPmtTrm,SPmtTrm)
"10001";"0";"Bergli Montasje AS";"Tore Hunds vei 17";"";"";"8400";"Sortland";"";"";"marius@bergli.as";"916525672";"";"47";"47";"";"15";"15"
"10349";"0";"Carrier Transicold scandinavia Norsk Avd";"Brages veg 8";"";"";"2060";"Gardermoen";"";"";"erland.vestli@carrier.com";"980441768";"";"47";"47";"";"15";"15"

@IMPORT_METHOD(3)

@WaBnd (ValDt, SrcTp, Descr)
"20240508" "12" "Quick3 Import"
@WaVo (VoNo,VoDt,ValDt,VoTp,Txt,DbAcNo,DbTrnCl,DbTxCd,CrAcNo,CrTrnCl,CrTxCd,Am,InvoNo,DueDt,VatAm,R1,R2,R7,CID,Txt2,AGRef)
"100542";"20240508";"20240508";"11";"Utg.faktura";"10001";"0";"0";"0";"0";"0";"12306.00";"100542";"20240518";"";"";"";"";"001000101005428";"";"";;
"100542";"20240508";"20240508";"11";"Utg.faktura";"0";"0";"0";"7740";"0";"0";"0.19";"";"";"";"";"";"";"";"";"";;
"100542";"20240508";"20240508";"11";"Utg.faktura";"0";"0";"0";"3001";"0";"3";"12305.81";"";"";"";"1";"";"";"";"";"";;
"100543";"20240508";"20240508";"11";"Utg.faktura";"10349";"0";"0";"0";"0";"0";"1712.00";"100543";"20240517";"";"";"";"";"001034901005437";"";"";;
"100543";"20240508";"20240508";"11";"Utg.faktura";"7740";"0";"0";"0";"0";"0";"0.26";"";"";"";"";"";"";"";"";"";;
"100543";"20240508";"20240508";"11";"Utg.faktura";"0";"0";"0";"3000";"0";"3";"1543.75";"";"";"";"4";"";"";"";"";"";;
"100543";"20240508";"20240508";"11";"Utg.faktura";"0";"0";"0";"3001";"0";"3";"168.51";"";"";"";"4";"";"";"";"";"";;

And, If i disconnect the modulen after the text parser, everything is okay.
But then again If i Connect and run a test it drives through and only tales the first customer.