KingdomFirst / Excavator

We have now released Bulldozer on GitHub. Bulldozer is the super-powerful big brother to Excavator. Because Bulldozer is now published on GitHub we will no longer be supporting Excavator. Thank you for all the support here!
https://github.com/KingdomFirst/Bulldozer
19 stars 20 forks source link

CSV: The Leading Zero in Phone Numbers are dropped #152

Closed leehockhin closed 7 years ago

leehockhin commented 8 years ago

In Malaysia, most of the phone numbers start with Zero (Zone codes, e.g. 05, are necessary especially when calling from a mobile phone).

Excavator seems to be dropping the leading zero from my phone numbers. Note: This looks like quite the opposite to the requirement in Issue #117 CSV: No Way to Set Phone Country Code

Please refer to the attached pdf file for details of the problem. Thanks Issues to report on Excavator Part 1.pdf

arranf commented 8 years ago

Leehockhin, thus is probably due to your regex setup in Rock as opposed to Excavator. Have you cong inured country specific regex?

On Mon, 2 May 2016 16:08 leehockhin, notifications@github.com wrote:

In Malaysia, most of the phone numbers start with Zero (Zone codes, e.g. 05, are necessary especially when calling from a mobile phone).

Excavator seems to be dropping the leading zero from my phone numbers. Note: This looks like quite the opposite to the requirement in Issue #117 https://github.com/NewSpring/Excavator/issues/117 CSV: No Way to Set Phone Country Code

Please refer to the attached pdf file for details of the problem. Thanks Issues to report on Excavator Part 1.pdf https://github.com/NewSpring/Excavator/files/245316/Issues.to.report.on.Excavator.Part.1.pdf

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/NewSpring/Excavator/issues/152

leehockhin commented 8 years ago

Hi Arranf, 1) Phone Country Code Regex is all new to me. I could not find much information in the Rock Manuals. Can you please direct me to documentation/notes on how to setup the Phone Country Codes in Rock?

2) How does Rock decide on the default Country Code for Phones?

arranf commented 8 years ago

@leehockhin I intend to do a short blog post showing how to configure Rock for international usage tomorrow evening (03/05/16 UK time). I'll cover that there.

leehockhin commented 8 years ago

I have setup my country specific regex; used the latest Excavator available BUT, excavator is still dropping the leading Zero from my Phone number.

The phone number is fine if I manually add back the missing leading Zero

arranf commented 8 years ago

@leehockhin http://www.rockrms.com/Rock/BookContent/9/64#internationalizationlocalization Rock already has great documentation on that stuff so turns out I'd be duplicating.

In the UK we also have leading 0 on our numbers and Jon who is the lead guy at Spark recommended we keep it like that in order to keep Twilio (SMS) functioning. It's something I'm hoping to tackle at some point. Let me know if you run into any more localisation issues I'd be happy to try and help.

arranf commented 8 years ago

@leehockhin Not everything is necessarily easy to find via Google. Asking in the Rock RMS Q&A is a good place to do it and so is joining the Slack channel

leehockhin commented 8 years ago

Summary: After a better understanding of Internationalization, setting up of regex codes, etc the problem with Excavator dropping the leading zero (did not test with more than one leading zero) still remains. Whilst I can perform work-arounds, I think Excavator should only remove non-numeric characters as (1) the input data on CSV is a string type and (2) the field dbo.PhoneNumber.Number (nvarchar) also supports leading zeros.

arranf commented 8 years ago

Looks like it's this https://github.com/NewSpring/Excavator/blob/master/Excavator.CSV/Maps/Individual.cs#L350

arranf commented 8 years ago

@leehockhin If you've already imported I can provide you with SQL to fix this. Am I right in thinking you're just testing?

leehockhin commented 8 years ago

@arranf Yes, I am still doing some trial runs. Most of the phone numbers I have in the csv file are like this screenshot of phone number in csv file Thus I think the code used is code line used The code evaluates phone numbers to a numeric value, so leading zeros will be dropped.

My workaround (in case I have overseas numbers with extra zeros, numbers not starting with Zero, etc) 1) Append a 9 in front of all my phone numbers 2) Import using Excavator 3) Remove the first digit of all my phone numbers using SQL

dcs619 commented 8 years ago

@leehockhin I've requested some time to look at this next week. The code @arranf posted would definitely prevent leading zeros from being added.

leehockhin commented 8 years ago

@dcs619 any updates on this?

treyhendon commented 8 years ago

@leehockhin is the "05" the Country Code in Rock? I'm wondering if it's the .AsNumeric() that's stripping the leading zero for the Country.

arranf commented 8 years ago

@treyhendon, country codes don't come by default in Rock. The line of code that's an issue is highlighted by me a little further up.

On Tue, 23 Aug 2016, 13:12 treyhendon, notifications@github.com wrote:

@leehockhin https://github.com/leehockhin is the "05" the Country Code in Rock? I'm wondering if it's the .AsNumeric() that's stripping the leading zero for the Country.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/NewSpring/Excavator/issues/152#issuecomment-241861392, or mute the thread https://github.com/notifications/unsubscribe-auth/AITM9kwvBU-wjSHdMqAjgIU-vYivmmTuks5qi1RFgaJpZM4IVbcs .

knolly42 commented 6 years ago

Hi

Looks like this issue is still alive?

I can see from my CSV the zero is there on the 3 x phone numbers in my single row CSV test file.

Post import, I can also see in SQL Server that the leading zero is missing on all three numbers, even though the regex is in place on my new test install?

I can run the update SQL post import to correct this, but thought I'd let you know it is still an issue at least for UK numbers with a leading '0'.

Thanks