kavya.s16
(Kavya S16)
April 28, 2022, 8:17am
1
Hi Everyone ,
My requirement is i need to replace the different types of double quotes
“ - “
” - ”
" - "
i have to replace these garbage values with quotes
eg: row1(“Col0”).Tostring.Replace(“””,“”") i am getting error for this @Palaniyappan @Gokul001 please help
Thanks in advance
Yoichi
(Yoichi)
April 28, 2022, 8:25am
2
Hi,
The following post might help you. Can you try to use ChrW(8220) and ChrW(8221)?
Hi,
In this case we need to use like the following expression. Probably because of normalization matter of Studio.
myString2.Replace(ChrW(8220)+"Company"+ChrW(8221),"XXX")
Regards,
Regards,
ppr
(Peter Preuss)
April 28, 2022, 8:49am
3
Protoyped the replacing with replacing to # for visual reasons
strPattern = String.Format("({0})", String.Join("|",{"""",ChrW(8220),ChrW(8221),"""}))
strPattern
"(\"|“|”|")"
strText
@"“ - “
” - ”
“ - ”
"" - ""
"" - ""
Regex.Replace(strText, strPattern,"#")
@"# - #
# - #
# - #
# - #
# - #"
kavya.s16
(Kavya S16)
April 28, 2022, 10:18am
4
No , i need to replace “ with “ or ” or " , not the other way around
kavya.s16:
i need to replace “
@kavya.s16 , Could you provide us with sample inputs that contain these kind of values that we need to replace?
We want to identify if it follows a particular pattern or is it always the same value.
kavya.s16
(Kavya S16)
April 28, 2022, 12:10pm
6
Company Holdings Advisors (Beijing) Company Limited (“BJWFOE”)
Is being extracted as Company Holdings Advisors (Beijing) Company Limited ("BJWFOE")
so i am trying to replace it
HTML 4.0 Special Entities according to data in this link
“ - & #8220 ;
” - & #8221 ;
" - & quot;
i have to replace them respectively
kavya.s16
(Kavya S16)
April 28, 2022, 4:32pm
8
can u provide the xaml if possible please!!
kavya.s16
(Kavya S16)
April 29, 2022, 5:48am
9
could u tell how to replace it with quotes instead of #
& #8220 ; ------- “
& #8221 ; --------”
& quot; -------"
@Palaniyappan @Gokul001
jeevith
(Jeevith Hegde, Ph.D.)
April 29, 2022, 6:13am
10
Hi @kavya.s16 ,
As @supermanPunch suggested, please provide both
Your input sample strings
Your required output after the replace
This way the forum members get a better idea what your inputs and expected output are. In such forums, asking questions clearly is important to get your problem resolved quickly.
kavya.s16
(Kavya S16)
April 29, 2022, 6:37am
11
above are the extracted data with garbage value/html entities
below is the actual data , so i need to use replace function @Palaniyappan @Gokul001 @jeevith @supermanPunch @ppr
kavya.s16:
image943×307 10.8 KB
@kavya.s16 , In that case, could you provide us with this Excel File, it would help us faster to work on the solution/suggest the steps required.
kavya.s16
(Kavya S16)
April 29, 2022, 6:45am
13
apologies , uploading file from client machine is restricted , i could just provide screenshot
ppr
(Peter Preuss)
April 29, 2022, 6:47am
14
Lets Crosscheck If HTML entity Decoding will better serve for the case
1 Like
Yoichi
(Yoichi)
April 29, 2022, 6:49am
15
Hi,
FYI, the following is ppr’s way.
System.Web.HttpUtility.HtmlDecode(yourString)
Regards,
1 Like
kavya.s16
(Kavya S16)
April 29, 2022, 6:53am
16
do i need to install any package to use this?
Yoichi
(Yoichi)
April 29, 2022, 6:55am
17
Hi,
Nope, we can use this method in default settings.
Regards,
ppr
(Peter Preuss)
April 29, 2022, 8:11am
18
@kavya.s16
for using
HttpUtility.HtmlDecode(yourString)
we will modify the XAML file in some cases, when the statement is not recognized by the compiler
Take a backup from your file in advance
open the xaml within a text editor (e.g. notepad++)
add following line to it
<AssemblyReference>System.Web</AssemblyReference>
reopen it in Studio
find starter help here:
EncodeDecodeStrings.xaml (5.5 KB)
Hi @Yoichi , i need to replace with this string “ which is left double quotation mark
I used HttpUtility.HtmlDecode(““”).Replace(“)
but it says string constants must end with double quotes @Palaniyappan @ppr
could u please help
Yoichi
(Yoichi)
May 2, 2022, 2:59am
20
Hi,
Do you want to replace double quote with left double quote? If so, the following will work
yourString.Replace(Chr(34),ChrW(8220))
Regards,