Solved

vb readline remove comma's

Posted on 2013-11-01
3
347 Views
Last Modified: 2013-11-01
folks

in my vb macro I am using the readline method that copies an entire row/line from a text file, how can I remove comma's from being carred into the line? the problem is that some of my rows contain comma's and seeing that I an writing the readline value into a text file with additional data's delimited with a comma from eachother which causes confusion

all help will do
0
Comment
Question by:rutgermons
3 Comments
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 500 total points
Comment Utility
Something like

var = replace(var,",","")
0
 
LVL 22

Expert Comment

by:rspahitz
Comment Utility
depending on the purpose of the commas, you may want to use the above but replace with tabs instead of empty-string:

var = replace(var,",",vbTab)

Or you may want to break the pieces up into parts and apply them in different ways as individual values:

Dim items() As String
Dim itemCntr As Integer

items = Split(inputlineText, ",")
For itemCntr=0 to UBound(items)
  Debug.Print items(itemCntr)' or other code to do something with the item
Next
0
 

Author Comment

by:rutgermons
Comment Utility
exactly what I needed

solution is : strData = Replace(objLogFile.ReadLine, ",", "")
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now