Gmail Calendar Documents Web Reader more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion Remove extra Double codes from CSV Files (vb Script Language)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Al Dunbar  
View profile  
 More options Nov 17 2009, 3:48 am
Newsgroups: microsoft.public.scripting.vbscript
From: "Al Dunbar" <aland...@hotmail.com>
Date: Mon, 16 Nov 2009 20:48:10 -0700
Local: Tues, Nov 17 2009 3:48 am
Subject: Re: Remove extra Double codes from CSV Files (vb Script Language)

"Learn4Develop" <Learn4Deve...@discussions.microsoft.com> wrote in message

news:C072F055-9B82-4D2D-A4D2-216403F47814@microsoft.com...

> On daily bases I have received files with double quotes comma separated,
> but
> in some records I found 2 times double quotes and some time different
> squence
> of double quotes placements.

> I just want to remove all unnecessary (extra) double quotes (see the
> following values where i want to remove extra double quotes.

> "0123x",""Company D-Val"","Class D, sector N","DD5894"
> "4894D",""Recycle" Rubbish, C class","Class D, Sector F, Block N","D870GH"
> "AB8679",""AB Ltd"",""Need" Clean Drive Way, stores","GF0347"

The rubbish line looks like exactly that. the first paired double quotes are
not matched by another such pair. In the context of your data, what does it
mean to have a doubled double-quote?

> I am looking the output like that.

> "0123x","Company D-Val","Class D, sector N","DD5894"
> "4894D","Recycle Rubbish, C class","Class D, Sector F, Block N","D870GH"
> "AB8679","AB Ltd","Need Clean Drive Way, stores","GF0347"

> Following code i used is work fine with ""Company D-Val"" but didn't work
> with ""Recycle" Rubbish, C class", The code is

> code:-
> Do While inFile.AtEndOfStream = False
> record = InFile.ReadLine()
> record = Replace(record, """", """") 'replace "" with single space

That replace call seems to change each double quote with exactly one double
quote.

Perhaps you just need to change each pair of double quotes with a single
double quote.

/Al

> outFile.WriteLine record & vbclrf
> Loop


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google