473,324 Members | 2,581 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Help with text files and delimiters

Hello, I'm a begginner with visual basic and need some help with a problem and would appreciate any help that can be offered

I would like vb to read a string of text in a text file like the following example:

223-1000-23,C23,C8,C59,C35
223-0000-22,C99,C345

and output like below in new txt file



223-1000-23,C23
223-1000-23,C8
223-1000-23,C59
223-1000-23,C35
223-0000-22,C99
223-0000-22,C345

the other variable is the delimiter could be a full stop and there could be a range for example

223-1000-23,C23-C25

I would like to look like this at output

223-1000-23,C23
223-1000-23,C24
223-1000-23,C25

Can anyone help?
Mar 10 '07 #1
1 1410
Killer42
8,435 Expert 8TB
Since you didn't say what version of VB you're using, I'm going to assume VB6 - other versions may vary.

I'd suggest you look into the Split() function to split the input text into chunks. Then a simple loop (probably a For loop) will run through each of the items on the line, and write it out along with a copy of the first.

Is this a school assignment?
Mar 10 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Keith Robinson | last post by:
Hi I wonder if anyone could help me with my grand-daughters home work? We are using a form to add data about personnel who work for our imaginary company. Each record has the employee's ID,...
6
by: paul | last post by:
HI! How do we send a variable from an Iframe page back to its parent? I have a script that calculates the iframe's window size but I need to know how to send that value back to its parent so I...
9
by: santosh | last post by:
Hello all, I've put together a small program to count the number of characters and 'words' in a text file. The minimum length of a word, (in terms of no. of characters), as well as word...
13
by: ern | last post by:
I'm using strtok( ) to capture lines of input. After I call "splitCommand", I call strtok( ) again to get the next line. Strtok( ) returns NULL (but there is more in the file...). That didn't...
32
by: robert d via AccessMonster.com | last post by:
I'm looking at converting DAO to ADO in my app. All of my DAO connections are of the following structure: Dim wsName As DAO.Workspace Dim dbName As DAO.Database Dim rsName As DAO.Recordset ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.