The UNIX and Linux Forums  
Hallo en welkom van de Verenigde Staten aan de UNIX en Linux Forum! Bedankt voor uw bezoek en Deelnemen aan onze wereldwijde gemeenschap.

Go Back   De Unix-en Linux Forum > Top Forums > Programmeren en Shell Scripting
.
google unix.com



Programmeren en Shell Scripting Post vragen over KSH, CSH, SH, Bash, Perl, PHP, sed, awk en andere shell scripts en shell scripting talen hier.

Meer UNIX en Linux Forum Onderwerpen Misschien vindt u Helpful
Draad Thread Starter Forum Antwoorden Last Post
zoek ")" met egrep - egrep: syntax error sagarjani UNIX voor Dummies Questions & Answers 7 10-14-2008 08:30
egrep / grep resultaat van meer bestanden tvrman Programmeren en Shell Scripting 3 08-07-2008 09:29
Egrep Cheat Sheet overal? Op zoek naar zin van egrep-c leelm UNIX voor Dummies Questions & Answers 2 01-11-2008 03:37 PM
Perl - het kopiëren van bestanden BG_JrAdmin Programmeren en Shell Scripting 1 12-13-2007 09:50 PM
Perl Bestanden uploaden sstevens UNIX for Advanced & Expert Gebruikers 16 02-24-2004 03:03 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Zoeken in deze Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-17-2008
thepurple thepurple is offline
Geregistreerde gebruiker
  
 

Join Datum: oktober 2007
Posts: 134
Perl of awk / egrep van grote bestanden?

Hallo deskundigen.

In een draad heb ik gevraagd hoe je grep de string uit de onderstaande voorbeeldbestand -

Helaas is het script niet heeft goede output (het gemiste veel strijkers). Het gebeurde kan ik deed gaf je de juiste inhoud van het bestand

Dat was de script -
"$ perl -00nle 'print toetreden "\ n", / <fullOperation> (.*?):.*< fullResult >(.*?);/ s' bestandsnaam.txt"

Nu voor je gemak Ik plak hier de inhoud van het begin van het bestand -

Uitgang van de onderstaande bestand zou -

CREATE
RESP: -3010

DELETE
RESP: 0

CREATE
RESP: 911364896

GET
RESP: 0

SET
RESP: 911265678


<? xml version \u003d'1 ,0 "encoding \u003d" ISO-8859-1 "standalone \u003d" nee "?>
<LogItems>
<log logid\u003d"83efeae5190811100759420954">
<category> Upstream.CAI </ categorie>
<operation> Login </ exploitatie>
<target> CAI </ doelgroep>
<instance> </ aanleg>
<user> </ gebruiker>
<context> </ context>
<fullOperation> LOGIN: server1: eri4ema </ fullOperation>
<starttime> 20081110075942,366900 </ Begintijd>
<stoptime> 20081110075942,424451 </ stoptime>
<fullResult> RESP: 3001; </ fullResult>
<status> FAILED </ status>
</ log>
<log logid\u003d"83efeae5190811100759480955">
<category> Upstream.CAI </ categorie>
<operation> Login </ exploitatie>
<target> CAI </ doelgroep>
<instance> </ aanleg>
<user> </ gebruiker>
<context> </ context>
<fullOperation> LOGIN: server1: eri4ema; </ fullOperation>
<starttime> 20081110075948,375669 </ Begintijd>
<stoptime> 20081110075948,375923 </ stoptime>
<fullResult> RESP: 3007; </ fullResult>
<status> FAILED </ status>
</ log>
<log logid\u003d"83efeae5190811100759580956">
<category> Upstream.CAI </ categorie>
<operation> Login </ exploitatie>
<target> CAI </ doelgroep>
<instance> </ aanleg>
<user> server1 </ gebruiker>
<context> SOG </ context>
<fullOperation> LOGIN: server1 :*******;</ fullOperation>
<starttime> 20081110075958,354986 </ Begintijd>
<stoptime> 20081110075958,355238 </ stoptime>
<fullResult> RESP: 0; </ fullResult>
<status> GESLAAGDE </ status>
</ log>
</ LogItems>

<? xml version \u003d'1 ,0 "encoding \u003d" ISO-8859-1 "standalone \u003d" nee "?>
<LogItems>
<log logid\u003d"83efeae5190811100802020957">
<category> Upstream.CAI </ categorie>
<operation> Get </ exploitatie>
<target> ESUB </ doelgroep>
<instance> CODE \u003d 432350114484630 </ aanleg>
<user> server1 </ gebruiker>
<context> SOG </ context>
<fullOperation> GET: ESUB: Code 432350114484630; </ fullOperation>
<starttime> 20081110080202,185236 </ Begintijd>
<stoptime> 20081110080202,834500 </ stoptime>
<fullResult> RESP: 11000003; ONBEKEND SUBSCRIBER; </ fullResult>
<status> FAILED </ status>
</ log>
</ LogItems>

<? xml version \u003d'1 ,0 "encoding \u003d" ISO-8859-1 "standalone \u003d" nee "?>
<LogItems>
<log logid\u003d"83efeae5190811100802120958">
<category> Upstream.CAI </ categorie>
<operation> Get </ exploitatie>
<target> DSUB </ doelgroep>
<instance> </ aanleg>
<user> server1 </ gebruiker>
<context> SOG </ context>
<fullOperation> GETSUB: MDN, 989352375449; </ fullOperation>
<starttime> 20081110080212,352053 </ Begintijd>
<stoptime> 20081110080213,376720 </ stoptime>
<fullResult> RESP: 0: MDN, 989352375449: Code 432350114484630: LAND, FI: LANG, fi: PRE, 0: SUBNAME, ESERVE: MMS, 1; </ fullResult>
<status> GESLAAGDE </ status>
</ log>
</ LogItems>

<? xml version \u003d'1 ,0 "encoding \u003d" ISO-8859-1 "standalone \u003d" nee "?>
<LogItems>
<log logid\u003d"83efeae5190811100802350959">
<category> Upstream.CAI </ categorie>
<operation> Get </ exploitatie>
<target> ACCOUNTINFORMATION </ doelgroep>
<instance> </ aanleg>
<user> server1 </ gebruiker>
<context> SOG </ context>
<fullOperation> GET: ACCOUNTINFORMATION: SubscriberNumber, 989352375449; </ fullOperation>
<starttime> 20081110080235,264165 </ Begintijd>
<stoptime> 20081110080235,555880 </ stoptime>
<fullResult> RESP: -3010; </ fullResult>
<status> FAILED </ status>
</ log>
<log logid\u003d"83efeae5190811100802450960">
<category> Upstream.CAI </ categorie>
<operation> Verwijderen </ exploitatie>
<target> EDSUB </ doelgroep>
<instance> </ aanleg>
<user> server1 </ gebruiker>
<context> SOG </ context>
<fullOperation> DELETE: EDSUB: Code 432350114484630: MDN, 989352375449: PRE, 0EST, ALL; </ fullOperation>
<starttime> 20081110080245,012208 </ Begintijd>
<stoptime> 20081110080245,857994 </ stoptime>
<fullResult> RESP: 0; </ fullResult>
<status> GESLAAGDE </ status>
</ log>
<log logid\u003d"83efeae5190811100802510961">
<category> Upstream.CAI </ categorie>
<operation> Maak </ exploitatie>
<target> EDSUB </ doelgroep>
<instance> </ aanleg>
<user> server1 </ gebruiker>
<context> SOG </ context>
<fullOperation> Maken: EDSUB: Code 432350114484630: KI, 1C9B39AAF3931D60C064F6E8FBB5B1E6: MDN, 98935237544 9: PRE, 0EST, ALL; </ fullOperation>
<starttime> 20081110080251,089898 </ Begintijd>
<stoptime> 20081110080251,489396 </ stoptime>
<fullResult> RESP: 911364896; </ fullResult>
<status> FAILED </ status>
</ log>
<log logid\u003d"83efeae5190811100802540962">
<category> Upstream.CAI </ categorie>
<operation> Get </ exploitatie>
<target> ESUB </ doelgroep>
<instance> CODE \u003d 432350114484630 </ aanleg>
<user> server1 </ gebruiker>
<context> SOG </ context>
<fullOperation> GET: ESUB: Code 432350114484630; </ fullOperation>
<starttime> 20081110080254,000313 </ Begintijd>
<stoptime> 20081110080254,697545 </ stoptime>
<fullResult> RESP: 0: MDN, 989352375449: Code 432350114484630: T11, 1: T21, 1: T22, 1: B16, 1: T62, 1: BAIC, 0: BAOC, 0: BOIC, 0: Biro, 0 : Boro, 0: BOIH, 0: BOS4, 0: CLIP, 1: CLIR, 0: CFB, 1: CFNR, 1: CFNA, 1: CFU, 1: HOLD, 1: CW, 1: MPTY, 1: BAICS , 0,0: BAOCS, 0,0: BOICS, 0,0: PRE, 0; </ fullResult>
<status> GESLAAGDE </ status>
</ log>
<log logid\u003d"83efeae5190811100802570963">
<category> Upstream.CAI </ categorie>
<operation> Set </ exploitatie>
<target> DSUB </ doelgroep>
<instance> </ aanleg>
<user> server1 </ gebruiker>
<context> SOG </ context>
<fullOperation> SETSUB: MDN, 989352375449; </ fullOperation>
<starttime> 20081110080257,888204 </ Begintijd>
<stoptime> 20081110080257,999121 </ stoptime>
<fullResult> RESP: 911265678; </ fullResult>
<status> FAILED </ status>
</ log>
</ LogItems>
 

Bladwijzers

Thread Tools Zoeken in deze Thread
Zoeken in deze Thread:

Uitgebreid zoeken
Display Modes Beoordeel deze draad
Beoordeel deze draad:

Posting Regels
Jij mag niet Post Nieuwe threads
Jij mag niet na antwoorden
Jij mag niet post attachments
Jij mag niet bewerk uw berichten

BB code is Aan
Smilies zijn Aan
[IMG] code Aan
HTML-code is Uit
Trackbacks zijn Aan
Pingbacks zijn Aan
Refbacks zijn Aan




Alle tijden zijn GMT -4. Het is nu 03:49.


Powered by: vBulletin, Copyright © 2000 - 2006, Jelsoft Enterprises Limited. Vertalingen Powered by .
vBCredits v1.4 Copyright © 2007 - 2008, PixelFX Studios
De Unix-en Linux Forums Copyright © 1993-2009. Alle rechten Reserved.Ad Beheer door RedTyger

Content Relevante URL's door vBSEO 3.2.0