Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
google site



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Closed Thread
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-14-2009
Registered User
 

Join Date: Oct 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Wink Archivo de datos con reg. duplicados

Hola , tengo un archivo de texto con 5 campos los cuales tiene en el segundo campo duplicado varios movientos con diferentes fechas y horas.

id num fecha hora valor3


Code:
1 2222 10/12/09 10:01 1000
2 2222 11/12/09 11:04 3000
3 4556 09/12/08 12:22 1900
4 4556 12/12/09 11:00 2900
5 1111 17/03/10 10:00 1100

Necesitaria un nuevo archivo el cual me registre el num y el moviento mas reciente con la fecha y la hora.

Gracias.

Last edited by Yogesh Sawant; 12-16-2009 at 04:42 AM.. Reason: added code tags
Sponsored Links
  #2  
Old 12-14-2009
zxmaus's Avatar
zxmaus zxmaus is offline Forum Advisor  
Event Manager
 

Join Date: May 2008
Location: in a putty session :)
Posts: 394
Thanks: 3
Thanked 8 Times in 7 Posts
Hello.

Per our forum rules, all posts must be in English.

We do provide translation services for posts from English to a number of languages as a benefit to users. However, posts must be in English.

Please repost in English.

Thank you for your cooperation.

The UNIX and Linux Forums.
  #3  
Old 12-14-2009
dennis.jacob's Avatar
dj - the student
 

Join Date: Feb 2007
Location: Bangalore/Cochin
Posts: 860
Thanks: 0
Thanked 5 Times in 4 Posts
Try:


Code:
awk '{ A[$2]=$0; }END { for (e in A) print A[e] }' file

  #4  
Old 12-15-2009
Registered User
 

Join Date: Oct 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
ok dennis , thank you . i try for next question , write in english .

regard
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




All times are GMT -4. The time now is 02:36 AM.