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 3333328
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:47:04+00:00 2026-05-17T23:47:04+00:00

I’m having trouble parsing some text. Here’s an example of the text: 201 BBQ

  • 0

I’m having trouble parsing some text. Here’s an example of the text:

   201 BBQ                 0.000    9.000    0.099    0.891    9.000    0.000    0.000    0.000

   705 W 1 PC              0.000  135.000    0.295   39.825    0.000    0.000  135.000    0.000

  2106 ONL 9.99           41.141    3.000    4.110   12.330    3.000    0.000    0.000   29.970

Here’s the latest incarnation of the code I’ve been trying:

  objInfo = System.Text.RegularExpressions.Regex.Split(
    newLine,"(\d{3,5})|([0-9]+[.]+[0-9]+)|(\w*)")

I’m having trouble because I’m avoiding getting many blank spaces in the array after splitting. I’m trying to avoid using the optional | character but I get no results when I set it up without it!

I’ve spent much of the evening reviewing regular expressions and I’ve downloaded the following programs:

RegEx Designer.NET
Antix RegEx Tester
Expresso

I’m having trouble because the description contains a decimal point SOMETIMES and sometimes it doesn’t. The description sometimes contains a whole number sometimes it doesn’t.

My friend recommended I use awk to divide it into columns. The thing is…I teach a Community Education class with Visual Basic .Net and I need to improve my RegEx skills. Perhaps someone can give me some guidance so I can better help my students.

  • 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-17T23:47:05+00:00Added an answer on May 17, 2026 at 11:47 pm

    Since you know the number of columns, you can start by reading 8 decimals from the end of the line, and take the rest as the title. You can avoid a regex, but here’s a simple solution with one:

    Match match = Regex.Match(line, @"^(.*)((?:\d+\.\d+\s*){8})$");
    string title = match.Groups[1].Value.Trim();
    IEnumerable<decimal> numbers = match.Groups[2].Value
        .Split(" \t".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
        .Select(Convert.ToDecimal);
    

    The regex captures two groups: ((?:\d+\.\d+\s*){8})$ is eight decimals at the end, and (.*) is the start of the sting until them. If you have extra decimals, as your third example, they will be added to the title.

    Similarly, you may choose a non-regex solution (actually, this one is better if you don’t mind losing a few spaces at the title):

    string[] words = line.Split(" ".ToCharArray(),
                                StringSplitOptions.RemoveEmptyEntries);
    int position = words.Count() - 8;
    IEnumerable<decimal> numbers = words.Skip(position).Select(Convert.ToDecimal);
    string title = String.Join(" ", words.Take(position));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have just tried to save a simple *.rtf file with some websites and
We're building an app, our first using Rails 3, and we're having to build
I have a text area in my form which accepts all possible characters from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.