954,557 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

removing comma in notepad

hey guys...i am doing a vb program that insert data into a notepad file....but i want these data without comma and without double quotes....so anyone can help me with my problem....plzz...and thak youuuuuuu

chabo
Newbie Poster
20 posts since Jan 2011
Reputation Points: 10
Solved Threads: 0
 

what is the source of data.

debasisdas
Posting Genius
6,872 posts since Feb 2007
Reputation Points: 666
Solved Threads: 434
 

Check help for REPLACE function.

gooptek
Newbie Poster
4 posts since Feb 2011
Reputation Points: 16
Solved Threads: 0
 

Before inserting data into the file, remove the commas and quotes. Then write the data. instr() might help.

WaltP
Posting Sage w/ dash of thyme
Moderator
10,507 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
 

debasisdas the source of data is from a datagrid....

chabo
Newbie Poster
20 posts since Jan 2011
Reputation Points: 10
Solved Threads: 0
 

WaltP i did that but it didn't work...

chabo
Newbie Poster
20 posts since Jan 2011
Reputation Points: 10
Solved Threads: 0
 

How you populate the datagrid ?

what is the code that you are working on ?

debasisdas
Posting Genius
6,872 posts since Feb 2007
Reputation Points: 666
Solved Threads: 434
 
WaltP i did that but it didn't work...


I hate it when people say that. And my standard response is "then you did it wrong". I've been using that technique for 30 years and it works.

If you need help, generic non-information posts like you've been giving us is not going to get you any closer to an answer. Be specific. Why didn't it work? What code did you use?

WaltP
Posting Sage w/ dash of thyme
Moderator
10,507 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
 

sorry WaltP you're write......my idea is that when you insert data from any toolbox in vb(ex.: textbox,datagrid,.....) to a notepad.....by default the inserted file will be separated by a comma and will be in a double quotes.....so i want to insert these data from vb to notepad without the comma and the double quotes....hope that i explained better.....and thank youuu

chabo
Newbie Poster
20 posts since Jan 2011
Reputation Points: 10
Solved Threads: 0
 

Hey chabo,

What is your code for the output??
If you're using

Open myfile for Ouput As #1

and then

Write #1,var1,var2

then change theWrite function with the Print
like this

Print #1,var1


Hope that helps.

KSS
Newbie Poster
21 posts since Mar 2009
Reputation Points: 11
Solved Threads: 3
 

The other thing to do is combine the variables as strings before writing to the file...

Write #1, var1 & var2


Of course if either variable is not a String you'll need to do Conversion and/or formatting.

If the above doesn't work as I remember, try combining the variables into one String before the write statement.

Temp = var1 & var2
Write #1,Temp


Also, you can use [CTRL]+G to bring up the debug window and then use debug.print VarName to view your variables to see what you are really passing to the Write function.

That way you can divide and conquer the problem and see where it is really happening at.

What I thin we are all suspecting is that the comma in what we suspect is your original code is being passed through the write function to the file.

Of course we can't really know that if you don't share a sample of your code... :)

SpiritualMadMan
Junior Poster in Training
70 posts since Sep 2010
Reputation Points: 49
Solved Threads: 5
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You