locked
Help with regular expression RRS feed

  • Question

  • Hi,

    I need to build a regex that convert this text into columns...
    I'm using this one (?<prefixo>\d+)\s+((?<LOCALIDADE>\w+)|(?<LOCALIDADE>\w+\s+\w+)|(?<LOCALIDADE>\w+\s+\w+\s+\w+))\s+\w.{1}\s+(?<VALOR>\d+\W\d+)

    But sometimes it do not capture because at localidade can apeear any king of letter and symbol...
    Here is the text as example..

     

    93 AFGHANISTAN R$ 1,02 9370 AFGHANISTANMOBILE R$ 1,10 9379 AFGHANISTANMOBILE R$ 1,10 355 ALBANIA R$ 0,26 35568 ALBANIAMOBILE R$ 1,00 35569 ALBANIAMOBILE R$ 1,00 3554 ALBANIATIRANA R$ 0,15 213 ALGERIA R$ 0,47 21321 ALGERIAALGIERS R$ 0,29 2136 ALGERIAMOBILE R$ 0,66 2137 ALGERIAMOBILE ORASCOM R$ 0,71 21350 ALGERIAMOBILE WATANIYA R$ 0,55 21351 ALGERIAMOBILE WATANIYA R$ 0,55 21352 ALGERIAMOBILE WATANIYA R$ 0,55 21353 ALGERIAMOBILE WATANIYA R$ 0,55 21354 ALGERIAMOBILE WATANIYA R$ 0,55 1684 AMERICAN SAMOA R$ 0,33 684 AMERICAN SAMOA R$ 0,33 376 ANDORRA R$ 0,10 3763 ANDORRAMOBILE R$ 1,11 3764 ANDORRAMOBILE R$ 1,11 3766 ANDORRAMOBILE R$ 1,11 244 ANGOLA R$ 0,58 2449 ANGOLAMOBILE R$ 0,94 1264 ANGUILLA R$ 0,53 1264235 ANGUILLAMOBILE R$ 0,61 1264722 ANGUILLAMOBILE R$ 0,61 672 ANTARCTICA R$ 2,39 1268 ANTIGUA R$ 0,52 1268404 ANTIGUAMOBILE R$ 0,52 1268464 ANTIGUAMOBILE R$ 0,52 1268723 ANTIGUAMOBILE R$ 0,52 1268724 ANTIGUAMOBILE R$ 0,52 1268725 ANTIGUAMOBILE R$ 0,52 1268726 ANTIGUAMOBILE R$ 0,52 1268727 ANTIGUAMOBILE R$ 0,52 1268728 ANTIGUAMOBILE R$ 0,52 1268729 ANTIGUAMOBILE R$ 0,52 1268764 ANTIGUAMOBILE R$ 0,52 1268770 ANTIGUAMOBILE R$ 0,52 1268771 ANTIGUAMOBILE R$ 0,52 1268772 ANTIGUAMOBILE R$ 0,52 1268773 ANTIGUAMOBILE R$ 0,52 1268774 ANTIGUAMOBILE R$ 0,52 1268775 ANTIGUAMOBILE R$ 0,52 1268938 ANTIGUAMOBILE R$ 0,52 54 ARGENTINA R$ 0,06 5411 ARGENTINABUENOS AIRES R$ 0,03 54351 ARGENTINACORDOBA R$ 0,04 54230 ARGENTINALOCAL CITIES R$ 0,04 54232 ARGENTINALOCAL CITIES R$ 0,04 54291 ARGENTINALOCAL CITIES R$ 0,04 54299 ARGENTINALOCAL CITIES R$ 0,04 54342 ARGENTINALOCAL CITIES R$ 0,04 54348 ARGENTINALOCAL CITIES R$ 0,04



    Thanks


    http://ZopoStyle.com || http://BrunoZP.com
    Thursday, August 21, 2008 6:48 PM

Answers