?
Solved

vb readline remove comma's

Posted on 2013-11-01
3
Medium Priority
?
383 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 2000 total points
ID: 39618048
Something like

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

Expert Comment

by:rspahitz
ID: 39618058
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
ID: 39618059
exactly what I needed

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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

850 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