🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #6109

Re: Extraer un dato de una linea

#6109
From: Nomentero
Date: Fri, 01 Aug 2003 12:48
19 lines
1772 bytes
> Sin embargo, si quiero filtrar:
> 
> video: 320x176, 20.00 fps,  (XVID), 149kbps
> 
> poniendo awk '/^video/{print $2}' obtengo '320x176,', y no se como decirle
> que acabe cuando se encuentre con x, y que finalice cuando se encuentre
> con ',' o que filtre hasta 'x' para obtener los dos datos, 320 y 176.
> 
> He probado poniendo el $ con varias combinaciones, pero nada.
> 
> Igual luego ley�ndome el manual entero mentero :-P

He visto que cambiando el field-separator con -F se puede hacer todo muy
bien :-)

Aunque seguro que hay una forma m�s sencilla:

# avinfo.exe s.avi | awk '/^video/{print $2}' | awk -F x '{print $1}'
320
Technical Details
Message-ID: <pan.2003.08.01.12.48.02.944818@hotmail.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!55.red-217-127-183.pooles.rima-tde.NET!not-for-mail
References: <pan.2003.08.01.11.14.30.975623@hotmail.com> <slrnbikkba.208.lerch.news@gurb.mine.nu> <pan.2003.08.01.12.03.39.425197@hotmail.com>

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,970632c53364e536
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2003-08-01 05:47:54 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!55.red-217-127-183.pooles.rima-tde.NET!not-for-mail
From: Nomentero <txukocomnospam@hotmail.com>
Newsgroups: es.comp.os.linux.programacion
Subject: Re: Extraer un dato de una linea
Date: Fri, 01 Aug 2003 14:48:02 +0200
Lines: 20
Message-ID: <pan.2003.08.01.12.48.02.944818@hotmail.com>
References: <pan.2003.08.01.11.14.30.975623@hotmail.com> <slrnbikkba.208.lerch.news@gurb.mine.nu> <pan.2003.08.01.12.03.39.425197@hotmail.com>
NNTP-Posting-Host: 55.red-217-127-183.pooles.rima-tde.net (217.127.183.55)
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de 1059742073 21868568 217.127.183.55 (16 [171873])
User-Agent: Pan/0.14.0 (I'm Being Nibbled to Death by Cats!)