ANATEL TXT - Regular Expression - MSDN - Microsoft [PDF]

ACALXI68126ALDEIA KAXARIRI ACRELÂNDIA 682A 683238 Brasil Telecom - Filial/AC 3000399910014200S 67024800ACLD ACRDNO68033R

3 downloads 33 Views 137KB Size

Recommend Stories


Regular Expression Searching
Open your mouth only if what you are going to say is more beautiful than the silience. BUDDHA

Regular Expression (regex)
You miss 100% of the shots you don’t take. Wayne Gretzky

DFA NFA Regular Language Regular Expression
We may have all come on different ships, but we're in the same boat now. M.L.King

ReadMe_IDPlus_v1.txt
Forget safety. Live where you fear to live. Destroy your reputation. Be notorious. Rumi

resultats trail 2016.txt
This being human is a guest house. Every morning is a new arrival. A joy, a depression, a meanness,

cono 2017 txt
Silence is the language of God, all else is poor translation. Rumi

Readme .txt for Pro
You often feel tired, not because you've done too much, but because you've done too little of what sparks

MSDN-AA Available Software List
Forget safety. Live where you fear to live. Destroy your reputation. Be notorious. Rumi

2012 - Gyselinck & Pazzaglia (txt)
If your life's work can be accomplished in your lifetime, you're not thinking big enough. Wes Jacks

Gcc参数.txt
No amount of guilt can solve the past, and no amount of anxiety can change the future. Anonymous

Idea Transcript


Home

Learn

Downloads

United States (English)



Search Windows Server with Bing



Community

Ask a question

Sign in

Search related threads

Search forum questions

Quick access

ANATEL TXT - Regular Expression

Answered by:

Archived Forums N-R > Regular Expressions

27,280



Points

Question

Top 0.5%

Hi,

OmegaMan MCC, MVP

Joined May 2008 OmegaMan's thr…

4

6

16

Show activity

Someone can help me with the regular expression to read this text...

0 Sign in to vote

SPADT 11001ADAMANTINA ADAMANTINA 189 183502 TELEFÔNICA-TELESP 0 999 21410700S 51042100ADT SPADT 11001ADAMANTINA ADAMANTINA 189 183502 TELEFÔNICA-TELESP 1000199921410700S 51042100ADT SPADT 11001ADAMANTINA ADAMANTINA 189 183502 TELEFÔNICA-TELESP 2000299921410700S 51042100ADT SPADT 11001ADAMANTINA ADAMANTINA 189 183502 TELEFÔNICA-TELESP 3000399921410700S 51042100ADT SPADT 11001ADAMANTINA ADAMANTINA 189 183502 TELEFÔNICA-TELESP 4000499921410700S 51042100ADT SPADT 11001ADAMANTINA ADAMANTINA 189 183502 TELEFÔNICA-TELESP 5000599921410700S 51042100ADT SPADT 11001ADAMANTINA ADAMANTINA 189 183502 TELEFÔNICA-TELESP 6000699921410700S 51042100ADT SPADT 11001ADAMANTINA ADAMANTINA 189 183502 TELEFÔNICA-TELESP 7000799921410700S 51042100ADT SPADT 11001ADAMANTINA ADAMANTINA 189 183502 TELEFÔNICA-TELESP 8000899921410700S 51042100ADT SPADT 11001ADAMANTINA ADAMANTINA 189 183502 TELEFÔNICA-TELESP 9000999921410700S 51042100ADT SPADT 11001ADAMANTINA ADAMANTINA 189 183521 TELEFÔNICA-TELESP 0 999 21410700S 51042100ADT SPADT 11001ADAMANTINA ADAMANTINA 189 183521 TELEFÔNICA-TELESP 1000199921410700S 51042100ADT SPADT 11001ADAMANTINA ADAMANTINA 189 183521 TELEFÔNICA-TELESP 2000299921410700S 51042100ADT SPADT 11001ADAMANTINA ADAMANTINA 189 183521 TELEFÔNICA-TELESP 3000399921410700S 51042100ADT SPADT 11001ADAMANTINA ADAMANTINA 189 183521 TELEFÔNICA-TELESP 4000499921410700S 51042100ADT SPADT 11001ADAMANTINA ADAMANTINA 189 183521 TELEFÔNICA-TELESP 5000599921410700S 51042100ADT SPADT 11001ADAMANTINA ADAMANTINA 189 183521 TELEFÔNICA-TELESP 6000699921410700S 51042100ADT ACACLD68032ACRELÂNDIA ACRELÂNDIA 682A 683235 Brasil Telecom - Filial/AC 1000199909494000S 66530000ACLD ACALXI68126ALDEIA KAXARIRI ACRELÂNDIA 682A 683238 Brasil Telecom - Filial/AC 3000399910014200S 67024800ACLD ACRDNO68033REDENCAO ACRELÂNDIA 682A 683238 Brasil Telecom - Filial/AC 1000199910022900S 67022000ACLD ACABL 68008ASSIS BRASIL ASSIS BRASIL 685 683548 Brasil Telecom - Filial/AC 1000199910562900S 69340100ABL ACBLI 68001BRASILÉIA BRASILÉIA 685 683546 Brasil Telecom - Filial/AC 3000499911005600S 68445100BLI The description of the fields is.. ----------------------------------------------------------ID FIELD NAME TIPO TAMANHO -- ---------------------------------- ---- ------01 Sigla UF char 02 02 Sigla CNL char 04 03 Codigo CNL char 05 04 Nome da Localidade char 50 05 Nome do Municipio char 50 06 Cod. da Area Tarifacao char 05 07 Prefixo char 07 08 Prestadora char 30 09 Num. da Faixa Inicial char 04 10 Num. da Faixa Final char 04 11 Latitude char 08 (*) 12 Hemisferio char 05 13 Longitude char 08 (*) 14 Sigla CNL da Área Local char 04

Here is char...but I want to read and remove the spaces... I'm using this one (?.{2})(?\w+)\s+(?.{5})(?\w+)\s+(? \d+)\s+(?\d+)\s+(?\w+\W\w+)\s+ But it's not reading everything...cause I don't know how to get the "Faixa Inicial" and the rest... And after that I'm gonna fill a dataset.. I think the it can be simplified... Thanks

Friday, July 27, 2007 2:49 PM 150 Points

BrunoZP BZPHost.com (Partner)

Answers I can only get these type data lines which seem to conform, starting at the ACACLD68032ACRELÂNDIA line, that seems to be a different format....

0 Sign in to vote

Input Text SPADT 11001ADAMANTINA ADAMANTINA 189 183502 TELEFÔNICA-TELESP 0 999 21410700S 51042100ADT SPADT 11001ADAMANTINA ADAMANTINA 189 183502 TELEFÔNICA-TELESP 1000199921410700S 51042100ADT SPADT 11001ADAMANTINA ADAMANTINA 189 183521 TELEFÔNICA-TELESP 0 999 21410700S 51042100ADT Regular Expression ^(?.{2}) (?[^\s]{1,4}) (?:\s+) # Match But don't capture space (MBDC) (?.{5}) (?[^\s]+) (?:\s+) # MBDC space (?[^\s]+) (?:\s+) (?[^\s]+) (?:\s+) (?[^\s]+) (?:\s+) (?[^\s]+) (?:\s+) (?\d{1,4}) (?:\s?) (?\d{1,4}) (?:\s?) (?.{8}) (?\w{1,4}) (?:\s+) (?.{8}) (?\w{1,4}) (?:[\r\n]{0,2}) # Cover the EOL or EOB

Group Captures Groups: (0) (UF) (SIGLACNL) (CODIGOCNL) (LOCALIDADE) (CODAREA) (PREFIXO) (OPERADORA) (Prestadora

Match (1): 0 : SPADT 11001ADAMANTINA ADAMANTINA 189 183502 TELEFÔNICA-TELESP 0 999 21410700S UF : SP SIGLACNL : ADT CODIGOCNL : 11001 LOCALIDADE : ADAMANTINA CODAREA : ADAMANTINA PREFIXO : 189 OPERADORA : 183502 Prestadora : TELEFÔNICA-TELESP FaixaInicial : 0 FaixaFinal : 999 Latitude : 21410700 Hemisferio : S Longitude : 51042100 SiglaCNLLocal : ADT

Match (2): 0 : SPADT 11001ADAMANTINA ADAMANTINA 189 183502 TELEFÔNICA-TELESP 1000199921410700 UF : SP SIGLACNL : ADT CODIGOCNL : 11001 LOCALIDADE : ADAMANTINA CODAREA : ADAMANTINA PREFIXO : 189 OPERADORA : 183502 Prestadora : TELEFÔNICA-TELESP FaixaInicial : 1000 FaixaFinal : 1999 Latitude : 21410700 Hemisferio : S Longitude : 51042100 SiglaCNLLocal : ADT

Match (3): 0 : SPADT 11001ADAMANTINA ADAMANTINA 189 183521 TELEFÔNICA-TELESP 0 999 21410700S UF : SP SIGLACNL : ADT CODIGOCNL : 11001 LOCALIDADE : ADAMANTINA CODAREA : ADAMANTINA PREFIXO : 189 OPERADORA : 183521 Prestadora : TELEFÔNICA-TELESP FaixaInicial : 0 FaixaFinal : 999 Latitude : 21410700 Hemisferio : S Longitude : 51042100 SiglaCNLLocal : ADT

Regex Options CompileECMA



Single

Multi

Ignore White

Explicit

Ignore

Right To

Culture

Line

Line

Space

Capture

Case

Left

Invariant



3

3











R e g e x I n f o G e n e r a t e d b y t h e R e g e x R e s p o n d e r V 2 . 0

Friday, July 27, 2007 4:39 PM

Moderator

OmegaMan Statera (MCC, MVP)

27,280 Points

All replies Is this a structured format data, if so why is there spaces between data? The ADT lines look like your regex but the ACRALANDIA line does not.

0

Friday, July 27, 2007 4:05 PM

Moderator

OmegaMan Statera (MCC, MVP)

Sign in to vote

27,280 Points

I can only get these type data lines which seem to conform, starting at the ACACLD68032ACRELÂNDIA line, that seems to be a different format....

0 Sign in to vote

Input Text SPADT 11001ADAMANTINA ADAMANTINA 189 183502 TELEFÔNICA-TELESP 0 999 21410700S 51042100ADT SPADT 11001ADAMANTINA ADAMANTINA 189 183502 TELEFÔNICA-TELESP 1000199921410700S 51042100ADT SPADT 11001ADAMANTINA ADAMANTINA 189 183521 TELEFÔNICA-TELESP 0 999 21410700S 51042100ADT Regular Expression ^(?.{2}) (?[^\s]{1,4}) (?:\s+) # Match But don't capture space (MBDC) (?.{5}) (?[^\s]+) (?:\s+) # MBDC space (?[^\s]+) (?:\s+) (?[^\s]+) (?:\s+) (?[^\s]+) (?:\s+) (?[^\s]+) (?:\s+) (?\d{1,4}) (?:\s?) (?\d{1,4}) (?:\s?) (?.{8}) (?\w{1,4}) (?:\s+) (?.{8}) (?\w{1,4}) (?:[\r\n]{0,2}) # Cover the EOL or EOB

Group Captures Groups: (0) (UF) (SIGLACNL) (CODIGOCNL) (LOCALIDADE) (CODAREA) (PREFIXO) (OPERADORA) (Prestadora

Match (1): 0 : SPADT 11001ADAMANTINA ADAMANTINA 189 183502 TELEFÔNICA-TELESP 0 999 21410700S UF : SP SIGLACNL : ADT CODIGOCNL : 11001 LOCALIDADE : ADAMANTINA CODAREA : ADAMANTINA PREFIXO : 189 OPERADORA : 183502 Prestadora : TELEFÔNICA-TELESP FaixaInicial : 0 FaixaFinal : 999 Latitude : 21410700 Hemisferio : S Longitude : 51042100 SiglaCNLLocal : ADT

Match (2): 0 : SPADT 11001ADAMANTINA ADAMANTINA 189 183502 TELEFÔNICA-TELESP 1000199921410700 UF : SP SIGLACNL : ADT CODIGOCNL : 11001 LOCALIDADE : ADAMANTINA CODAREA : ADAMANTINA PREFIXO : 189 OPERADORA : 183502 Prestadora : TELEFÔNICA-TELESP FaixaInicial : 1000 FaixaFinal : 1999 Latitude : 21410700 Hemisferio : S Longitude : 51042100 SiglaCNLLocal : ADT

Match (3): 0 : SPADT 11001ADAMANTINA ADAMANTINA 189 183521 TELEFÔNICA-TELESP 0 999 21410700S UF : SP SIGLACNL : ADT CODIGOCNL : 11001 LOCALIDADE : ADAMANTINA CODAREA : ADAMANTINA PREFIXO : 189 OPERADORA : 183521 Prestadora : TELEFÔNICA-TELESP FaixaInicial : 0 FaixaFinal : 999 Latitude : 21410700 Hemisferio : S Longitude : 51042100 SiglaCNLLocal : ADT

Regex Options CompileECMA





Single

Multi

Ignore White

Explicit

Ignore

Right To

Culture

Line

Line

Space

Capture

Case

Left

Invariant



3

3









R e g e x I n f o G e n e r a t e d b y t h e R e g e x R e s p o n d e r V 2 . 0

Friday, July 27, 2007 4:39 PM

Moderator

OmegaMan Statera (MCC, MVP)

27,280 Points

OK, From this point I can go on... And make the others expressions for similar statements

0 Sign in to vote

Thaks

Friday, July 27, 2007 7:07 PM

BrunoZP BZPHost.com (Partner)

© 2018 Microsoft. All rights reserved. Terms of Use

| Trademarks | Privacy Statement | Site Feedback

150 Points

Smile Life

When life gives you a hundred reasons to cry, show life that you have a thousand reasons to smile

Get in touch

© Copyright 2015 - 2024 PDFFOX.COM - All rights reserved.