Comando seleccionar(selecionar) lineas(Linhas) | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


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

Comando seleccionar(selecionar) lineas(Linhas)

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 12-10-2010
mcanhizares mcanhizares is offline
Registered User
 
Join Date: Dec 2010
Last Activity: 10 December 2010, 8:23 AM EST
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Comando seleccionar(selecionar) lineas(Linhas)

Hola, he empezado la carrera de informática y tengo que hacer uno ejercicios con Cygwin ( mismos comandos que UNIX ).

Y en el ejercicio me dice que tengo que abrir un archivo .csv y que selecione las lineas en que en la tercera columna el valor sea 4 y en la cuarta columna el valor sea 2, he estado buscando pero no sé como hacerlo, alguiém me puede ayuda ?!

saludos y muchas gracias.


Oi, começei a fazer a faculdade de informática e tenho que fazer uns exercicios usando Cygwin.

Eu teho que abrir um arquivo .csv e selecionar as linhas que tenha valor 4 na terceira coluna e 2 na quarta coluna, e não sei como fazer.

alguém pode me ajudar ?

obrigado.
Sponsored Links
    #2  
Old 12-10-2010
cabrao cabrao is offline
Registered User
 
Join Date: Aug 2009
Last Activity: 15 April 2013, 7:39 AM EDT
Posts: 201
Thanks: 37
Thanked 24 Times in 24 Posts

Code:
$ cat file.csv
1;2;3;4;5
1;1;4;2;1

$ awk -F\; '$3=="4" && $4=="2"' file.csv
1;1;4;2;1

Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Eliminar lineas con SED en Bash? adiegorpc Shell Programming and Scripting 1 10-07-2010 10:57 AM
Dividir fichero en numero de lineas uri_crack Shell Programming and Scripting 3 06-09-2010 07:53 AM
Eliminar lineas con ****** kekaes Shell Programming and Scripting 1 04-23-2010 07:33 AM
salida de comando a variable daaran Programming 1 10-17-2009 02:19 PM
Comando para montar automaticamente un Dlt Kespinoza97 HP-UX 1 12-07-2005 10:24 AM



All times are GMT -4. The time now is 12:26 PM.