🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: [OT] una pregunta de examen

#10563
From: Claudio S.
Date: Fri, 22 Feb 2002 21:53
46 lines
2353 bytes
El Fri, 22 Feb 2002 11:50:26 +0100, marmolejo <marmolejo@escomposlinux.org>
escribi�:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>>  El Wed, 20 Feb 2002 11:24:40 +0100, pip <correopriv@hotmail.com> escribi�:
>>  
>>  
>>  join
>>  
>>  � lo conoc�as ?
> 
> Pos no, pero cojon�o, oiga, ahora a ver :)) :
> 
> [11:47][portatil@portathost:~/bin/prueba]$ cat fich1.dat
> 001:Jose:Perez
> 002:Juan:Camps
> 004:Luis:Bisbal
> 003:Pedro:Guerra
> [11:47][portatil@portathost:~/bin/prueba]$ cat fich2.dat
> Pintor:002
> Cantante:004
> Informatico:001
> Compositor:003
> [11:47][portatil@portathost:~/bin/prueba]$ join -i -t : -1 1 fich1.dat \
>                 -2 2 fich2.dat |sort
> 002:Juan:Camps:Pintor
> 003:Pedro:Guerra:Compositor
> 004:Luis:Bisbal:Cantante
> 
> 
> Usea, no consigo el 001 �? Ta mirao el man y el info y no encuentro el
> por qu� �cu�l ser�a la sinaxis correcta?

Es que los ficheros deben estar ordenados
previamente por el campo que se hace el join.

 sort -t: -k1n fich1.dat > fich1.dat.tmp  # campo 1
 sort -t: -k2n fich2.dat > fich2.dat.tmp  # campo 2
 join -t: -1 1 -2 2 fich1.tmp fich2.tmp

>  Porque ahorrar�a mucho curro:)

Sip �verdad? Yo lo descubr� cuando ya no me hac�a tanta falta.

Un saludo.
--claudio--
Technical Details
Message-ID: <8le65a.ru1.ln@127.0.0.1>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!newsfeed00.sul.t-online.de!t-online.de!news-lei1.dfn.de!news-fra1.dfn.de!fu-berlin.de!uni-berlin.de!139.red-80-59-173.pooles.rima-tde.NET!not-for-mail
References: <a4vth7$4qf$1@news.ua.es> <av045a.ep.ln@127.0.0.1> <slrna7c8ja.5hm.marmolejo@porta.til>

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,cf1b769eafe4ae69
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2002-02-22 15:25:54 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!newsfeed00.sul.t-online.de!t-online.de!news-lei1.dfn.de!news-fra1.dfn.de!fu-berlin.de!uni-berlin.de!139.red-80-59-173.pooles.rima-tde.NET!not-for-mail
From: "Claudio S." <claudio@dev.null.org>
Newsgroups: es.comp.os.linux.programacion
Subject: Re: [OT] una pregunta de examen
Date: Fri, 22 Feb 2002 22:53:44 +0100
Lines: 46
Message-ID: <8le65a.ru1.ln@127.0.0.1>
References: <a4vth7$4qf$1@news.ua.es> <av045a.ep.ln@127.0.0.1> <slrna7c8ja.5hm.marmolejo@porta.til>
NNTP-Posting-Host: 139.red-80-59-173.pooles.rima-tde.net (80.59.173.139)
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: fu-berlin.de 1014420351 5293154 80.59.173.139 (16 [130458])
X-Orig-Path: 127.0.0.1!nobody
User-Agent: slrn/0.9.7.3 (Linux)