Sponsored Content
Top Forums Shell Programming and Scripting Comando seleccionar(selecionar) lineas(Linhas) Post 302479170 by cabrao on Friday 10th of December 2010 03:16:36 AM
Old 12-10-2010
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

 

6 More Discussions You Might Find Interesting

1. HP-UX

Comando para montar automaticamente un Dlt

Hola no escribo en ingles, pero si alguno puede ayudarme.. Quisiera saber si hay algun comando en unix que me permita hacer el mecanismo de montar el cassette a la unidad de dlt, asi como se que existe para que la expulse , quisiera saber si hay comando, que por decir la introduzca... (1 Reply)
Discussion started by: Kespinoza97
1 Replies

2. Shell Programming and Scripting

Comparar 2 archivos y agregas lineas faltantes

Hi I have 2 files where i save the IP adress of many printers that work on UNIX, one of these files, which is the 'Main File', is on a server call PROD, and the other one is on a different server call Al. What I want, is to make a comparison between the 2 files, and then, copy the IPs that... (4 Replies)
Discussion started by: Athlon1
4 Replies

3. Programming

salida de comando a variable

Buenas, estoy intentando hacer lo siguiente: Enviar un comando at a un telefono movil y recibir la respuesta para tratarla. Algo estaré haciendo mal que usando open, write y read, solo consigo enviarle el comando pero no capturar la respuesta, solo aparece en pantalla por el terminal. Asi que... (1 Reply)
Discussion started by: daaran
1 Replies

4. Shell Programming and Scripting

Eliminar lineas con ******

Hola. Tengo un problema. En un archivo tengo distintos campos y en alguno de ellos y en alguna linea me aparecen ******. ej: hola 0.1 ****** 85 adios 1.2 9650 23 gracias 2 ****** 54 bye 87 5666 89 hi ... (1 Reply)
Discussion started by: kekaes
1 Replies

5. Shell Programming and Scripting

Dividir fichero en numero de lineas

Hola, Estoy haciendo un script y queria de un archivo por ejemplo de 650 lineas, recortarlo y hacer archivos mas pequeños de 100 lineas, y que me salieran 7 archivos, por poner un ejemplo. No tengo ni idea de hacerlo la verdad....xD Un saludo y gracias! (3 Replies)
Discussion started by: uri_crack
3 Replies

6. Shell Programming and Scripting

Eliminar lineas con SED en Bash?

Hola a todos les cuento que estoy haciendo un programa en bash y queria saber como puedo hacer para borrar lineas de un documento de las palabras que NO terminen en S con SED, es decir, mostrar solamente las que terminan con la letra S. les cuento que probe con: sed -e /$.*/d "$archivo" |... (1 Reply)
Discussion started by: adiegorpc
1 Replies
ROLLDICE(6)							   Games Manual 						       ROLLDICE(6)

NAME
rolldice - rolls virtual dice SYNOPSIS
rolldice [ options ] dice_string dice_string ... DESCRIPTION
rolldice rolls virtual dice. The dice strings passed on the command line contain information on the dice to roll in a format comparable to the format used in fantasy role playing games. OPTIONS
-h,--help returns the usage of diceroll -v,--version returns the version of diceroll -r,--random uses /dev/random for random number generating -u,--urandom uses /dev/urandom for random number generating (default) -s,--separate prints out the result of each individual die separately, as well as the operations and totals DICE STRING FORMAT
The dice string uses the following format: {#x}{#}d[#|%]{*#}{+/-#}{s#} The dice string doesn't have to be in the format that I outlined above, but this is the nicest order for me. It will try to parse any dif- ferent string containing the same sections in the best way it can, and will throw out anything that isn't one of the sections below. {#}d[#|%] This is the only required part of the string, and now really isn't even required, as it defaults to 1d6 if not found. The first number is the number of dice to roll, and the second number is the number of sides the dice have. The numbers rolled on each die are then added up and given as the result. Hence 3d6 means "roll three six-sided dice, add them together and return the result". If the first number is left out, then the number of dice defaults to 1. If the second number is not a number, but a percentage sign, then the number of sides becomes 100 (for a percentage roll). {#x} This number tells how many times to roll. For example, if you want to roll 3 6-sided dice 6 times, you would say 6x3d6. This would return six numbers, corresponding to the six different rolls. {*#} This number tells how many times to multiply the result of each roll. 3d6*100 would return a number in the range of 300-1800, since 3-18 is the range resulting from 3d6, which is then multipled by 100. {+/-#} This number is the modifier to be added or subtracted, depending on the sign, from each roll. 1d4+1 would result in a range from 2-5 (1-4 for the die, plus 1). This step is handled *after* the multiplication modifier. {s#} This number tells the program to drop the # lowest dice rolls. This step is handled *before* the multiplication modifier. in the order show above. For an extreme example, "3x4d6*5+1s2" would roll four six-sided dice, drop the lowest two, multiply the result by 5, add 1 to that, and repeat the process two more times, for a total of three results. DIAGNOSTICS
The following error messages may appear on STDERR: Failure in getting dice attributes Either memory could not be allocated while parsing the string passed to the rolldice program or an invalid dice string was entered. Failure in rolling dice Memory could not be allocated while actually rolling the dice. Unknown option Take a wild guess ;) BUGS
I haven't noticed any yet... rolldice is a quick hack to provide a virtual dice roller for FRPGs that I play. Any improvements are greatly welcome, as I am not the most experienced C coder... AUTHOR
Stevie Strickland <sstrickl@cc.gatech.edu> VERSION
1.10 - 25 Nov 2001 Linux 25 Nov 2001 ROLLDICE(6)
All times are GMT -4. The time now is 04:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy