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

Recommended Answers

All 10 Replies

what is the source of data.

Check help for REPLACE function.

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

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

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

How you populate the datagrid ?

what is the code that you are working on ?

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?

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

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 the Write function with the Print
like this

Print #1,var1

Hope that helps.

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... :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.