| Off Topic A place for members to tell a joke, share a funny story and generally goof off with each other. |
![]() |
|
|
#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. |
|
|
|
| Sponsored Links |
|
|
|
|
#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 |
|
|
|
|
|
#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:
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. |
|
|
|
|
|
|
#14 (permalink) | |
|
|
Re: Any VBscript whizzs?
Quote:
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. |
|
|
|
|
![]() |
| Bookmarks |
| Tags |
| vbscript, whizzs |
| Thread Tools | |
|
|