zoofreek Posted July 1, 2023 Share Posted July 1, 2023 (edited) Hello I have an irregular character string that can contain the following 8 contents = Name : x1-y1 Telef : x2-y2 P.O. Box : x3-y3 City : x4-y4 xn = all characters except carriage return yn = all characters after line feed I'm looking for a method to generate the following 8 sub-strings = Name 1 = Name: x1 2 = y1 (maybe empty) 3 = Telef : x2 4 = y2 (maybe empty) 5 = C.P. : x3 6 = y3 (maybe empty) 7 = City: x4 8 = y4 (maybe empty) If possible, the same contents always in the same position/column (i.e. recognize and order the right sub-contents when they exist, in the appropriate column/position = y4 should always be in position/column 8). We can use fivxrr or upwxrk for this. THANK YOU Edited July 1, 2023 by zoofreek Quote Link to comment https://forums.phpfreaks.com/topic/317035-how-to-recognize-and-sort-sub-strings-in-a-string/ Share on other sites More sharing options...
Barand Posted July 1, 2023 Share Posted July 1, 2023 Can you post an example of an "irregular character string" that you want to process? Quote Link to comment https://forums.phpfreaks.com/topic/317035-how-to-recognize-and-sort-sub-strings-in-a-string/#findComment-1610155 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.