in Education by
I am parsing text that has a heading and then data that applies to that heading. I need to break each data field into groups, and have the heading also apply to those groups. Here's an example: (Update: The text below has been updated to better reflect it's current layout, and to indicate an annotation.) Heading 1 Heading 2 Heading 3 (Group 1) data1 data2 data3 data4 data5 (Group 2) data1 data2 data3 data4 data5 (Group 3) data1 data2 data3 data4 data5 ** The headers become different values here *** (this is not part of the data) NewHeading 1 NewHeading 2 NewHeading 3 (Group 4) data1 data2 data3 data4 data5 (Group 5) data1 data2 data3 data4 data5 **etc The output should be like this: (Group 1) Heading1 Heading2 Heading3 data1 data2 data3 data4 data5 (Group 2) Heading1 Heading2 Heading3 data1 data2 data3 data4 data5 (Group 3) Heading1 Heading2 Heading3 data1 data2 data3 data4 data5 (Group 4) NewHeading1 NewHeading2 NewHeading3 data1 data2 data3 data4 data5 (Group 5) NewHeading1 NewHeading2 NewHeading3 data1 data2 data3 data4 data5 The fields marked (Group 1-5) are just labels for the line, they are not meant to be part of the returned set. The Headings changing to "NewHeading" is merely to indicate that the header values have changed and should be applied to the data that follows it. I've done a bit of reading over the past couple of hours looking for what this is called, but I haven't had any luck. Any ideas? This is for the .Net regex engine. Update: Annotations added, and showed that the headers change over the file. I have also done some research and believe I can accomplish something almost as easy by having two patterns. One for the headers, and one for the data. Then I can compare the header and data match index (ie: where it is found in the file) to each other and combine them that way. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
1) Loop through line by line. This isn't the place for a regex 2) You really need to clarify your question. It isn't clear if (Group 1) and ** The headings become different here ** are part of your input, or whether you're annotating it.

Related questions

0 votes
    I am parsing text that has a heading and then data that applies to that heading. I need to break ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
0 votes
    So the problem is i don't get get a value from textbox field on GridView RowUpdating event. Here ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 8, 2022 in Education by JackTerrance
0 votes
    I'm modifying someone else's code where a query is performed using the following: DataSet ds = new ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 23, 2022 in Education by JackTerrance
0 votes
    I have been developing a webpage which uses n number of dropdownlists which are binding dynamically inside a ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 18, 2022 in Education by JackTerrance
0 votes
    I want create expression with reflection in c#. I am target script is: using (var service = new ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 14, 2022 in Education by JackTerrance
0 votes
    I have a Login control placed inside LoginView control contained within a PANEL. I want to set login button ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 8, 2022 in Education by JackTerrance
0 votes
    All How can I download a file so the user sees that it is downloading (like with a stream?) I ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 2, 2022 in Education by JackTerrance
0 votes
    I'm trying to add data into my Access database in Visual Basic, but I encount this error when I ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 26, 2022 in Education by JackTerrance
0 votes
    I'm working on a DNN skin using Christoc's DNN templates and when I create a normal ASP.NET ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 26, 2022 in Education by JackTerrance
0 votes
    I'm trying to generate an 837P EDI file using EDIDev. I was able to generate 4 other 837P files ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 19, 2022 in Education by JackTerrance
0 votes
    I have tried many solution online but I am unable to fix. First off all i check in bin and it ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I have a database (SQL Server) with clients and a MVC plataform, and i want a row to be "hidden ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I was wondering if there is a way to compress my code using a loop, this is my code : ( ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    What is the .vs folder used for exactly? It gets created at the base folder of my solution. I ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I was wondering if there is a way to compress my code using a loop, this is my code : ( ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
...