Calling all VBScript experts ! - HotUKDeals
We use cookie files to improve site functionality and personalisation. By continuing to use HUKD, you accept our cookie and privacy policy.
Get the HUKD app free at Google Play

Search Error

An error occurred when searching, please try again!

Login / Sign UpSubmit

Calling all VBScript experts !

Cyrus Avatar
8y, 6m agoPosted 8 years, 6 months ago
I have two csv files

The first one is that which I want to read information from
The second is that which I want to paste the information into the first csv file in a specific place.

What I am trying to do is convert the layout of one csv into a different layout

Can anyone please help or at least start me off! :)

Thanks guys
Cyrus Avatar
8y, 6m agoPosted 8 years, 6 months ago

All Comments

(8) Jump to unreadPost a comment
CSV, comma seperated values?

I'm not a VB expert but I sould suspect you could use something like string.split(), for each line of the file?

Check the API.
you using ?
Need more info: Is this a one off or something you need to be repeatable? Any specific reason why VBScript? Is it .NET or old style VBScript?
Thanks guys (and gals?)

I need to read from one csv and write to another from the first one. It needs to be done through excel.

It should be quite simple, simple if and while loops.
is this the kind of thing you are looking for?

Well for the read anyway, I dont like VB but found this with some of my old work.

Private Sub cmdReadFile_Click()
'open and read from the file

Dim person As String, telno As String
Dim fnum As Integer

Cls 'Clears the form
fnum = FreeFile
Open "n:\Visual Basic\VB Exerc HNU\chapter 6\readtest.txt" For Input As #fnum 'open file for reading
Do While Not EOF(fnum)
Input #fnum, person 'read name from file
Input #fnum, telno 'read telephone numbe from file
Print person, telno 'Prints the name and telephone number on the form
Loop 'keep going round the loop until
Close #fnum 'End Of File is reached

End Sub
Have a read of the Wikipedia CSV page: there are links to info on manipulating CSV files in a number of languages, including VBScript.
thanks a lot guys!
I will look at the wiki site
LadyMadonna: Not sure ... will study it in just a bit and let yo uknow

you guys are awesome!
Thanks to all for their help

i managed to get this piece of work doen today with the help of various sites, and of course your help as above. Mission completed ...

thanks again.

Post a Comment

You don't need an account to leave a comment. Just enter your email address. We'll keep it private.

...OR log in with your social account

...OR comment using your social account

Thanks for your comment! Keep it up!
We just need to have a quick look and it will be live soon.
The community is happy to hear your opinion! Keep contributing!