• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Insert spaces between English and Arabic

mdavid

Member
Hi, I have this column of (Phonetic)English and Arabic data:
Code:
csv_ctax_arabic-plus-phonetic
talh anbari   طلح أنباري, talh al-fitna   طلح الفتنة, talh hulw   طلح حلو, sant ‘arabi   سنط عربي
khanziri   خنزيري
akhiliya   أخيليا, zakzakat al-'usfur   زقزقة العصفور, b'eithran   بعيثران, qaisum   قيصوم
qaisum   قيصوم, bissum   بسوم, qaisum jabali   قيصوم جبلي, qaisun   قيصون
sha'r el-khanzir   شعر الخنزير, kuzbaret el-bi'r / el-bir   كزبرة البئر/ البير, sha'r el-'ard   شعر الأرض, sha'r el-'ajuz   شعر العجوز
jawi   جاوي
shandaqur   شندقور, `ishbet el-dizintarya   عشبة الدزنطريا
`ishbet el-dam el-sharqiya   عشبه الدم الشرقية, `arsaf sharqi   عرصف شرقي
ward al-jimal   ورد الجمال, khubbeza barriya   خبازى برية, khatmiyya zahifa   خطم ية زاحفة,khubz el-'adra   خبز العذرا, khatma   ختمة
ward el-hasad   ورد الحصاد, khuff el-jamal   خف الجمل, ward el-hisan   ورد الحصان, khubbeizet zuhur   خبيزة زهور, khatmiyeh   ختميه
el-'aqul   العاقول, shirsh el-'aqul   شرش العاقول, shok el-jimal   شوك الجمال
taranjamin / tranjemin / tranjamin  طرنجمين / ترنجمين, taranjamish   طرنجمش, 'aqul   عاقول, shabraq   شبرق, shirsh el-'aqul   شرش العاقول
hawa' jawi el-sharq   هواء جوي الشرق, hinna'ya   حنائية
hawa juwani   هواء جواني
I need to upload this to a website, with the Arabic and English separate by 4 spaces - if I load English and Arabic separately they don't stay together, so I need to replace this:
Code:
khatmiyya zahifa   خطم ية زاحفة
with this
Code:
khatmiyya zahifa       خطم ية زاحفة
'cause html collapses contiguous spaces to one space.
What would be the vba code to locate the space(s) between the (phonetic) English and the Arabic?
Thanks for any help
 
Hi Vletm, Here it is, thought the problem column was enough - but if this helps me get a solution, I'm very grateful.
The problem column is column P.
Thanks
 

Attachments

  • Eng-Arabic.xlsm
    130 KB · Views: 3
mdavid
Did You read #2 reply's at all?
Did You write about csv-file ... or how?
Where is that sample csv-file?
If You won't use csv-file then
... where are expected results based Your sample [csv-file]?
The problem ... hmm? I won't even guess - what would that be?
 
Hi,​
maybe you do not ever need any VBA procedure just using Excel basics like the Replace feature …​
For further help on VBA side, according to your sample workbook post at least the expected text file result.​
 
I have no idea how to locate the position between the Arabic and English in the cell - just replacing spaces with the Replace feature is not enough 'cause there's lots of spaces in the text
Here's a csv file hope it helps me.
 

Attachments

  • Eng-Arb-sample.csv
    19.2 KB · Views: 1
Just warming a couple of neurons you must see you even do not need to locate anything according to columns N & O​
or just with the Replace Excel feature at beginner level …​
 
And according to your post #7 attachment there is nothing to do or it's very not the expected result … :rolleyes:
 
mdavid
based Your #5 reply
I don't talk - I asked something and You uploaded something else.
You have some texts --- okay?
... which You would look something different --- okay?
Then You should able to show
few samples, how those look before and after?
Of course, You have shown something with Your original writing
... but if You would like to have something exact ... then You should show that something exact.
... as I and Marc L have tried to get from You.
If You cannot give clear rules then ... You can wait.
 
And as any Excel beginner - at kid level ! - can select the column P then call the Excel Search / Replace feature​
in order to replace the spaces with the expected html string …​
If really a VBA procedure is necessary, needing just a single codeline, a good start to learn is​
to activate the Macro Recorder and to operate manually in order to get your own code base.​
 
As I said There's many spaces in the cell text. I just need the space between Arabic and Ebglish text as I showed in #1
 
So why don't you just use the Find / Replace Excel feature ?!​
The kid way : edit a cell in column P, use the arrow keys to move the text cursor until the first space to replace​
in order to count how many spaces must be replaced, is it so difficult ?​
Then you just call the Find / Replace Excel feature in order to replace the same number of spaces with the expected html string …​
 
I'd like to automate this, I have around a 1000 places I need to replace the space between the 2 languages.
Thanks
 
Think I'm missing something. I need a specific place in the string - where there's an English character, space(s), Arabic character. I don't want to do this a 1000 times manually. Looking for some vba code to locate the position in the string.
 
mdavid
The keyword is מְדוּיָק
I just need the space between Arabic and Ebglish text as I showed in #1
by 4 spaces ...      
( how many ... four? How many spaces are between ... text-spaces? )
I need to replace the space between the 2 languages.
I need a specific place in the string

As many times ... this needs to get input and expected output ( Your some of above versions are not מְדוּיָק ).
 
Here's 2 csv files input and expected output
Thanks for all your help
 

Attachments

  • Eng-Arb-input.csv
    7.7 KB · Views: 1
  • Eng-Arb-output.csv
    8.3 KB · Views: 1
I'd like to automate this, I have around a 1000 places I need to replace the space between the 2 languages.
Thanks
How can you so badly read ?! Did I write 1 000 times ?! You can replace all the column at once. :rolleyes:
I gave it to a kid beginner as a training and he achieved it in less than a minute with the generation of the code …​
As I wrote that needs a single codeline but as you want to do nothing, I'm off now.​
As a reminder, solution belongs to good enough readers …​
 
Hi vletm, Thanks for this solution.
I'm sorry about the misunderstanding. I also did a search/replace for 3 spaces to 3 x  
but what I wanted to know was how to find the space between English and Arabic.
Sorry I didn't ask the right question, thanks for your help
 
mdavid
If You are interesting
... then You would show that You're interesting in
as well as
You could answer that question, which I write #19 reply?
That was not any solution (#19 reply).

What are You writing about search/replace?
Do You have new challenge?
Isn't this tread about insert... ?
Your ... the right question ... I see ... if You would ask 1+2=? but You would need 1*2=?
then there will be some challenges to get needed answer.
 
Back
Top