Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6717087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:48:40+00:00 2026-05-26T08:48:40+00:00

I need to parse a CSV file with blocks of text being processed in

  • 0

I need to parse a CSV file with blocks of text being processed in different ways according to certain rules, e.g.

userone,columnone,columntwo
userthirteen,columnone,columntwo
usertwenty,columnone,columntwo

customerone,columnone<br>
customertwo,columntwo<br>

singlevalueone
singlevaluetwo

singlevalueone_otherruleapplies
singlevaluethree_otherruleapplies

Each block of text will be grouped so the first three rows will be parsed using certain rules and so on. Notice that the last two groups have only one single column but each group must be handled in a different way.

I have the chance to propose the customer the format of the file so I’m thinking to propose the following.

[group 1]
userone,columnone,columntwo
userthirteen,columnone,columntwo
usertwenty,columnone,columntwo

[group N]
rowN

A kind of sections like the INI files from some years ago. However I’d like to hear your comments because I think there must be a better way to handle this.

I proposed to use XML but the customer prefers the text files.

Any suggestions are welcome.

m0dest0.

Ps. using VB.net and VS 2008

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:48:40+00:00Added an answer on May 26, 2026 at 8:48 am

    You can use regular expression groups set to either an enum line mode if each line has the same format, or to an enum multi-line if the format is not constrained to a single line. For each line in multiline you can include \n in your pattern to cross multiple lines to find you pattern. If its on a single line you don’t need to include \n also know as Carriage return line feed in your regex matching pattern.

    vb.net as well as many other modern programming language has extensive support for grouping operations. You can use index groups, or named groups.

    Each name such as header1 or whatever you want to name it would be in this format: <myname>
    See this link for more info: How do I access named capturing groups in a .NET Regex?.

    Good luck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to parse a pretty simple csv file which represents 7 columns and
Using Ruby 1.9.2 I need to parse a CSV file, and output lines with
I need a regex that will parse a csv-style file, something like 57 fields
I need to parse an CSV file using AWK. A line in the CSV
Hi Need a shell script to parse through the csv file - Line by
I need to load in a large CSV file (>1MB) and parse it. Generally
I need a CSVParser class file A Class File which parses csv and returns
I need parse through a file and do some processing into it. The file
Need to parse a file for lines of data that start with this pattern
I need to parse a xml file which is practically an image of a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.