Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    Convert all Contact Numbers

    Reply
    Page 2 of 3 | Prev |   1   2   3   | Next
    Obsidian | # 11 | 2014-04-30, 13:54 | Report

    Originally Posted by saponga View Post
    Does anyone wrote a script that i can adapt to my case ?
    Try this in the folder where your vcf files are:
    Code:
    grep -l ':+[89][0-9]\{7\}$' *.vcf | xargs sed -i '/:+[89][0-9]\{7\}$/s/\+/\+9/g'
    I'm not sure if I installed sed from the repositories or if it's part of maemo anyway. So If sed is not found, you'll have to install it.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to Obsidian For This Useful Post:
    saponga

     
    Aonsaithya | # 12 | 2014-04-30, 13:57 | Report

    I'd just sync the contacts to Outlook or similar, export them to an excel file, modify the information with functions or such and finally reverse the process to get the updates to the phone.

    In fact, I think I have done that some time in the past.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to Aonsaithya For This Useful Post:
    saponga

     
    saponga | # 13 | 2014-04-30, 14:23 | Report

    Originally Posted by Obsidian View Post
    Try this in the folder where your vcf files are:
    Code:
    grep -l ':+[89][0-9]\{7\}$' *.vcf | xargs sed -i '/:+[89][0-9]\{7\}$/s/\+/\+9/g'
    .
    Thanks bro... I did try it on my kali box but:
    Code:
    ~/Exported contacts$ grep -l ':+[89][0-9]\{7\}$' *.vcf | xargs sed -i '/:+[89][0-9]\{7\}$/s/\+/\+9/g'
    sed: no input files
    I should try to debug your line but i really didn't understand anything
    And, yes, the .vcf files are in that folder. Am i missing something ?

    edit: busybox gives me another output:
    Code:
    ~/MyDocs/Exported contacts $ grep -l ':+[89][0-9]\{7\}$' *.vcf | xargs sed -i '
    /:+[89][0-9]\{7\}$/s/\+/\+9/g'
    sed: -i requires an argument
    Thanks again buddy !!!

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by saponga; 2014-04-30 at 15:11.

     
    saponga | # 14 | 2014-04-30, 14:31 | Report

    Originally Posted by Aonsaithya View Post
    I'd just sync the contacts to Outlook or similar, export them to an excel file, modify the information with functions or such and finally reverse the process to get the updates to the phone.
    That is a good idea... Although i'll wait and see if someone has already managed to solve that situation using (b)ash.
    Thanks for the tip !!!

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Obsidian | # 15 | 2014-04-30, 22:31 | Report

    The command should be in one line with no breaks.

    It's a combination of two commands: the grep lists all the files that match the pattern (regular expression) and hands them over to the sed, that does the find & replace part.

    If the grep doesn't find any files, it won't work. The pattern I used is:
    1. a colon (
    2. a plus-sign (+)
    3. either 8 or 9
    4. seven digits (from 0 to 9)
    5. end of line ($)

    Maybe you find a pattern that works or you give me an anonymised vcf-file for testing purposes.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to Obsidian For This Useful Post:
    saponga

     
    caveman | # 16 | 2014-04-30, 23:51 | Report

    I have a quick script for the br scenario. I look 4 it and post later.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to caveman For This Useful Post:
    saponga

     
    saponga | # 17 | 2014-05-01, 00:48 | Report

    Originally Posted by Obsidian View Post
    The command should be in one line with no breaks.
    Well... i just did a copy/paste...
    Originally Posted by

    It's a combination of two commands: the grep lists all the files that match the pattern (regular expression) and hands them over to the sed, that does the find & replace part.

    If the grep doesn't find any files, it won't work. The pattern I used is:
    1. a colon (
    2. a plus-sign (+)
    3. either 8 or 9
    4. seven digits (from 0 to 9)
    5. end of line ($)
    Thanks for your patience. I'll try to understand that line for sure.

    Originally Posted by
    Maybe you find a pattern that works or you give me an anonymised vcf-file for testing purposes.
    Thanks again. I'm attatching a .vcf file.

    Edit | Forward | Quote | Quick Reply | Thanks
    Attached Files
    File Type: txt Alice.vcf.txt (163 Bytes, 55 views)

     
    saponga | # 18 | 2014-05-01, 00:49 | Report

    Originally Posted by caveman View Post
    I have a quick script for the br scenario. I look 4 it and post later.
    I'll really apreciate that. Thanks.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Obsidian | # 19 | 2014-05-01, 08:05 | Report

    I see, there's no leading plus sign. Just remove it from the pattern in the grep command and in the sed command and it should work:
    Code:
    grep -l ':[89][0-9]\{7\}$' *.vcf | xargs sed -i '/:[89][0-9]\{7\}$/s/\+/\+9/g'

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to Obsidian For This Useful Post:
    saponga

     
    peterleinchen | # 20 | 2014-05-01, 19:56 | Report

    @saponga
    Is this
    Code:
    sed  '/:[89][0-9]\{7\}\>/s/:/:9/g' -i *.vcf
    what you are looking for?

    @obsidian
    there should be no need for xargs, or?
    $ did not work so I used \>

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to peterleinchen For This Useful Post:
    saponga

     
    Page 2 of 3 | Prev |   1   2   3   | Next
vBulletin® Version 3.8.8
Normal Logout