Sponsored Content
Full Discussion: help one liner...
Top Forums Shell Programming and Scripting help one liner... Post 302529291 by vidyadhar85 on Thursday 9th of June 2011 02:37:52 AM
Old 06-09-2011
This will print all the lines where there is a lonley number which is greater than 2000

Code:
 
awk 'chunk=$0{gsub(/[^0-9]/,"");{if($0> 2000){print chunk}}}'  filename

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

1 liner question

This works: nslookup `uname -n`|tail -2|awk -F: '{print $2}' This does not aa=`nslookup `uname -n`|tail -2|awk -F: '{print $2}'` Why??? Solaris v10 Thanks Brandt (6 Replies)
Discussion started by: beppler
6 Replies

2. Shell Programming and Scripting

awk one liner

input a 100 200 300 b 400 10 output a 100 a 200 a 300 b 400 b 10 Thanx (6 Replies)
Discussion started by: repinementer
6 Replies

3. UNIX for Dummies Questions & Answers

awk one liner

I need a one liner to" find /pattern/ print from x lines before "pattern" to y lines after "pattern" (3 Replies)
Discussion started by: kenneth.mcbride
3 Replies

4. UNIX for Dummies Questions & Answers

one-liner for my script

Hi all, Happy weekend. I have the following sample.txt file which contains the students name and their marks of different subjects. kamaraj@kamaraj-laptop:~/Desktop/testing$ cat sample.txt kamaraj 34 kamaraj 35 kamaraj 56 raj 32 raj 324 raj 93 raj 93 test 1 test 1 test 1 test... (5 Replies)
Discussion started by: itkamaraj
5 Replies

5. UNIX for Dummies Questions & Answers

need an awk one liner

example input file: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 (3 Replies)
Discussion started by: kenneth.mcbride
3 Replies

6. Shell Programming and Scripting

Need a one liner

abc/abc1/abc2/abc3/abc4 i need a script to pick this above path when ever any patterns like the below will be found. abc/abc1 abc/abc1/abc2 abc1/abc2/abc3 abc2/abc3/abc4 abc2/abc3/ etc .... etc..... not only the above 5 but like these one.. any one liner will be of great... (1 Reply)
Discussion started by: debu182
1 Replies

7. Shell Programming and Scripting

Search & Replace regex Perl one liner to AWK one liner

Thanks for giving your time and effort to answer questions and helping newbies like me understand awk. I have a huge file, millions of lines, so perl takes quite a bit of time, I'd like to convert these perl one liners to awk. Basically I'd like all lines with ISA sandwiched between... (9 Replies)
Discussion started by: verge
9 Replies

8. UNIX for Advanced & Expert Users

Curl one liner

Hi I am trying to write a curl one-liner that will help me to input the password after intiating the upload. Also this curl job needs to run on the background and transfer the verbose output to a file. So we can tail the file and check the status if required. This is curl command that I am... (1 Reply)
Discussion started by: cutechaps
1 Replies

9. Shell Programming and Scripting

PERL one liner

hi, I am using PERL one liner for oracle database connection as : $PERL -e "use DBI; DBI->connect(qw(DBI:Oracle:SID user passwd));" is there a way to append select statement to this connection ? i.e. DB connection and select stmt in one line ? how to do sysdba connection using one lines... (1 Reply)
Discussion started by: talashil
1 Replies

10. Shell Programming and Scripting

Shell one liner help

Hello, I am trying to sort/get some specific output from a ls command but however I am having no luck. The command I am using is 'ls -al /nim/dr/mksysb/\*'|grep -e _dr -e .tgz|cut -c37-90|cut -d" " -f2-8|cut -d_ -f1 the error is bash: ls -al /nim/dr/mksysb/\*: No such file or directory ... (1 Reply)
Discussion started by: hasn318
1 Replies
pack_fopen_chunk(3alleg4)					  Allegro manual					 pack_fopen_chunk(3alleg4)

NAME
pack_fopen_chunk - Opens a sub-chunk of a file. Allegro game programming library. SYNOPSIS
#include <allegro.h> PACKFILE *pack_fopen_chunk(PACKFILE *f, int pack); DESCRIPTION
Opens a sub-chunk of a file. Chunks are primarily intended for use by the datafile code, but they may also be useful for your own file rou- tines. A chunk provides a logical view of part of a file, which can be compressed as an individual entity and will automatically insert and check length counts to prevent reading past the end of the chunk. The PACKFILE parameter is a previously opened file, and `pack' is a bool- ean parameter which will turn compression on for the sub-chunk if it is non-zero. Example: PACKFILE *output = pack_fopen("out.raw", "w!"); ... /* Create a sub-chunk with compression. */ output = pack_fopen_chunk(output, 1); if (!output) abort_on_error("Error saving data!"); /* Write some data to the sub-chunk. */ ... /* Close the sub-chunk, recovering parent file. */ output = pack_fclose_chunk(output); The data written to the chunk will be prefixed with two length counts (32-bit, a.k.a. big-endian). For uncompressed chunks these will both be set to the size of the data in the chunk. For compressed chunks (created by setting the `pack' flag), the first length will be the raw size of the chunk, and the second will be the negative size of the uncompressed data. To read the chunk, use the following code: PACKFILE *input = pack_fopen("out.raw", "rp"); ... input = pack_fopen_chunk(input, 1); /* Read data from the sub-chunk and close it. */ ... input = pack_fclose_chunk(input); This sequence will read the length counts created when the chunk was written, and automatically decompress the contents of the chunk if it was compressed. The length will also be used to prevent reading past the end of the chunk (Allegro will return EOF if you attempt this), and to automatically skip past any unread chunk data when you call pack_fclose_chunk(). Chunks can be nested inside each other by making repeated calls to pack_fopen_chunk(). When writing a file, the compression status is inherited from the parent file, so you only need to set the pack flag if the parent is not compressed but you want to pack the chunk data. If the parent file is already open in packed mode, setting the pack flag will result in data being compressed twice: once as it is written to the chunk, and again as the chunk passes it on to the parent file. RETURN VALUE
Returns a pointer to the sub-chunked PACKFILE, or NULL if there was some error (eg. you are using a custom PACKFILE vtable). SEE ALSO
pack_fclose_chunk(3alleg4), pack_fopen(3alleg4) Allegro version 4.4.2 pack_fopen_chunk(3alleg4)
All times are GMT -4. The time now is 08:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy