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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:29:55+00:00 2026-05-11T20:29:55+00:00

i have the following string: http://pastebin.com/d29ae565b i need to separate each value and put

  • 0

i have the following string:

http://pastebin.com/d29ae565b

i need to separate each value and put it in an array. typically it would be done by “.split”. however i need it to be split in this order: 0, 50, 100, 200, 400 etc..

does anyone know how to do this? please note that i need to do this in VB

in other words, i need it to read the rows left to right. i have no problem separating each number, i just need it to read it in the specified order.

thank you all for your suggestions. ive tried the regexp and i forgot to mention that after each line there is a line break. i am not sure if this would impact the regex, but in any case, after i do the regex, i get the following order: 0, 6.65, 84..??, 35…. etc

i am not getting the order i need as stated above

expected results: 0, 50, 100, 100, 200, 400, 218, 9.8, ???, 6.65, 6.31 etc…

i am going to follow some of the suggestions below by splitting up the string into separate lines initially. this code almost does that:

Dim fields() As String
        fields = calculationText.Split(vbCrLf)

unfortunately for some reason the spaces are lost. when i look into the array, all the spaces between numbers are lost. why?????????

  • 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-11T20:29:55+00:00Added an answer on May 11, 2026 at 8:29 pm

    It sounds to me like you need to split things twice. Read the file line by line into an array, or better yet a List(Of String), and then iterate through each “line” in the List and do a subsequent split based on the space.

    As you go through each line, you can add the first element into your result array, list.

    EDIT: Since you’re having some troubles, try out this code and see if it works for you:

    Dim lstResulst As New List(Of String)
    Dim lstContent As New List(Of String)
    Dim LineItems() As String
    Dim objStreamReader as StreamReader
    
    objStreamReader = File.OpenText(FILENAME)
    
    While objStreamReader.Peek() <> -1
      lstContent.Add(objStreamReader.ReadLine())
    End While
    
    objStreamReader.Close()
    

    This reads all of your files line per line into a List(Of String). Then from there you can do this:

    For Each CurrLine As String In lstContent
       LineItems = CurrLine.Split(Char.Parse(" "))
       lstResults.Add(LineItems(0))
    Next
    

    That’ll split each item into an array and you can dump the first item of the split into a new List(Of String). You can easily dump this into a list of Decimals or whatever and simply wrap the CurrLine.Split around the appropriate conversion method. The rest of the items on the line will be available in the LineItems array as well.

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

Sidebar

Ask A Question

Stats

  • Questions 123k
  • Answers 123k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer In Delphi 2007 there is a unit called HTTPApp.pas (in… May 12, 2026 at 1:03 am
  • Editorial Team
    Editorial Team added an answer NOTE: See other answers and comments below - old info… May 12, 2026 at 1:03 am
  • Editorial Team
    Editorial Team added an answer I doubt you need a pool here. You're over-releasing the… May 12, 2026 at 1:03 am

Related Questions

Possible Duplicate: splitting a string i have a string which looks like this: http://pastebin.com/m5508ff19
I have the following string: Look on http://www.google.com. I need to convert it to:
I'm trying to access list data using SSRS 2008. I have created an XML
I have the following regex that isn't working. I want to match the string

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.