The Warlocks Den - WoW Warlock DiscussionsThe Warlocks Den - WoW Warlock Discussions



Please Register to Remove these Ads

The Warlocks Den - WoW Warlock Discussions » General » Off Topic » Any VBscript whizzs?

Off Topic A place for members to tell a joke, share a funny story and generally goof off with each other.

Reply
Old April 10, 2009, 04:02 PM   #11 (permalink)

Character Info
Debuff
80 Orc Warlock
Sargeras US PvP
Guild: Fenrir
Profile: Blizzard Armory
Talent Spec: 0/13/58
Re: Any VBscript whizzs?

Yeah the reason I need to get this working in code is because it will be used for thousands of tables. So unless you want to volunteer for doing it manually in SSMS code looks like the best option :P

Thanks, though.
Debuff is offline   Reply With Quote
Sponsored Links

Old April 10, 2009, 04:18 PM   #12 (permalink)

Character Info
Lavath
80 Blood Elf Warlock
Shadow Council US RP Profile: Blizzard Armory
Talent Spec: 3/13/55
Re: Any VBscript whizzs?

I've got it:

Code:
For Each Address in myDB
 Get(SomeoneElse.DoThis(forMe))
Next
Lavath is offline   Reply With Quote
Old April 10, 2009, 04:28 PM   #13 (permalink)

Character Info
Debuff
80 Orc Warlock
Sargeras US PvP
Guild: Fenrir
Profile: Blizzard Armory
Talent Spec: 0/13/58
Re: Any VBscript whizzs?

Hahaha, I like it!

Now if I can only get it to compile...
--- Information Added ---
Quote:
Originally Posted by Debuff View Post
Yeah, that's what I'm afraid of. i'm thinking I might be able to specify some bogus character as a row delimiter in the GetString method so I can do a simple Replace() on the whole text without worrying about screwing up the end of row delimeter. I'll update with how it goes...
This is pretty much what I ended up doing and it works like a champ. It's ghetto as hell but it works and this is likely a one-time use script so I'm not worried. The updated code can be seen here: VisualBasic pastebin - collaborative debugging tool

Basically, when I call GetString now to convert the recordset into text I tell it to delimit rows with "#$" (since I know it isnt used in any of the fields). This way I can do Replace(strFileData, vbcr, " ") and Replace(strFileData, vblf, " ") on the whole chunk of text to remove the CRLF that was in the fields without having to worry about the row delimiters. After that, I just do another replace to get the row delimeters back to the CRLF character before outputting to the file.
Debuff is offline   Reply With Quote
Old July 13, 2009, 02:25 PM   #14 (permalink)

Character Info
asdasd
12 Human Paladin
sása Asia RP PvE
Guild: fjk
Talent Spec: 0/21/4
Re: Any VBscript whizzs?

Quote:
Originally Posted by Debuff View Post
The only problem with this is that this occurs after the GetString method which means that after doing that replace the .csv file will be one huge line (the replace will remove the legitimate CRLF's at the end of each line).
Hi there.
I'm not even a video game player (the forum registration asked a lot of questions about WoW). I was googling for something else and ended up here. Saw your problem, and given that i know the answer as i had the same problem a few months ago, i'd like to share it with you.

This solution only works if your CSV has character delimited fields, like a comma or semicolon. For the sake of the explanation, i'll asume a semicolon.

It's just a few replaces.
1) First, replace all ";"+CRLF with a really odd character, like "¬" (i usually use that one, as nobody ever uses it on a string).
2) Then, replace all other CRLFs by a space or an empty string.
3) Last, replace all "¬" with ";"+CRLF.

And that's all.
If it's a lenght delimited field CSV, then maybe you can guess wich one's the right end-line CRLF, and apply this ugly trick on that place.

C ya.
Xelort is offline   Reply With Quote
Reply

Bookmarks

Tags
vbscript, whizzs

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -4. The time now is 07:40 AM.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.0