Sponsored Content
Top Forums Shell Programming and Scripting [AWK] handeling data spread on multiple lines Post 302504287 by maverick72 on Monday 14th of March 2011 08:05:09 AM
Old 03-14-2011
Works great!

I modified it a little bit cause some lines where not being handle correctly but now it works like a charm.

I will remember this trick!

Thanks!!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Handeling multiple options in script

i need to be able to handel if multiple commands are passed into my script. (ie) -f -r -i . does anyone know a simple solution to handeling this. Thanks (2 Replies)
Discussion started by: virus_stinger
2 Replies

2. UNIX for Dummies Questions & Answers

Can I spread commands over multiple lines?

Below an example of what I mean. The first attempt does what I want; the second doesn't, because bash assumes a line break means the end of an individual "command unix". Is there some way that I can convince bash to parse out, eg, to the closing parenthesis? I'm thinking this would allow for... (1 Reply)
Discussion started by: tphyahoo
1 Replies

3. Programming

spawning multiple processes spread across two files

I want to spawn n child processes but have two different classes..with the foremost one forking/spawning the child process and the latter performing a function w/ the spawned processes. I can do this in one class with an if statement and the simple if((pid=fork())==0) //child process { ... (1 Reply)
Discussion started by: StrengthThaDon
1 Replies

4. Shell Programming and Scripting

removing pattern which is spread in multiple lines

I have several huge files wich contains oracle table creation scripts as follows: I would need to remove the pattern colored in red above. Any sed/awk/pearl code will be of much help. Thanks (2 Replies)
Discussion started by: sabyasm
2 Replies

5. Shell Programming and Scripting

search for a string spread in multiple line

Hi, I have to look for the full string below in a large file(>5GB) , but that string may be spread in two lines. string :-- "f8f8 f5f0 f0f0 f1f7 f4f7 f7c1" By grep "f8f8 f5f0 f0f0 f1f7 f4f7 f7c1" file | tail -1 , I am getting incorrect result because there is a line after this also which... (1 Reply)
Discussion started by: finder255
1 Replies

6. UNIX for Dummies Questions & Answers

how to fill the name of the spread sheet as a cell's data

In open office spreadsheet, i would like to fill a cell with the name of the spread sheet. That is if the file name of spread sheet is, team.ods, then i have to fill a specific cell with that name 'team'. How to do that ? I have more spread sheets to be created, so i want it to be done... (0 Replies)
Discussion started by: thegeek
0 Replies

7. Shell Programming and Scripting

FTP GET with exception handeling and multiple conditions

Thanks everyone for the wonderful and helping environment.. And the problem I asked.. forget it... 4 days wait for a decent reply was such a moral booster.. (3 Replies)
Discussion started by: ReignOfChaos
3 Replies

8. Shell Programming and Scripting

Awk match multiple columns in multiple lines in single file

Hi, Input 7488 7389 chr1.fa chr1.fa 3546 9887 chr5.fa chr9.fa 7387 7898 chrX.fa chr3.fa 7488 7389 chr21.fa chr3.fa 7488 7389 chr1.fa chr1.fa 3546 9887 chr9.fa chr5.fa 7898 7387 chrX.fa chr3.fa Desired Output 7488 7389 chr1.fa chr1.fa 2 3546 9887 chr5.fa chr9.fa 2... (2 Replies)
Discussion started by: jacobs.smith
2 Replies

9. Shell Programming and Scripting

Merging multiple lines to columns with awk, while inserting commas for missing lines

Hello all, I have a large csv file where there are four types of rows I need to merge into one row per person, where there is a column for each possible code / type of row, even if that code/row isn't there for that person. In the csv, a person may be listed from one to four times... (9 Replies)
Discussion started by: RalphNY
9 Replies

10. UNIX for Beginners Questions & Answers

Remove newline character from column spread over multiple lines in a file

Hi, I came across one issue recently where output from one of the columns of the table from where i am creating input file has newline characters hence, record in the file is spread over multiple lines. Fields in the file are separated by pipe (|) delimiter. As header will never have newline... (4 Replies)
Discussion started by: Prathmesh
4 Replies
ex12bit(3alleg4)						  Allegro manual						  ex12bit(3alleg4)

NAME
ex12bit - How to fake a 12-bit truecolor mode on an 8-bit card. Allegro game programming library. SYNOPSIS
#include <allegro.h> Example ex12bit DESCRIPTION
This program sets up a 12-bit mode on any 8-bit card, by setting up a 256-colour palette that will fool the eye into grouping two 8-bit pixels into one 12-bit pixel. In order to do this, you make your 256-colour palette with all the combinations of blue and green, assuming green ranges from 0-15 and blue from 0-14. This takes up 16x15=240 colours. This leaves 16 colours to use as red (red ranges from 0-15). Then you put your green/blue in one pixel, and your red in the pixel next to it. The eye gets fooled into thinking it's all one pixel. The example starts setting a normal 256 color mode, and construct a special palette for it. But then comes the trick: you need to write to a set of two adjacent pixels to form a single 12 bit dot. Two eight bit pixels is the same as one 16 bit pixel, so after setting the video mode you need to hack the screen bitmap about, halving the width and changing it to use the 16 bit drawing code. Then, once you have packed a color into the correct format (using the makecol12() function below), any of the normal Allegro drawing functions can be used with this 12 bit display! Things to note: The horizontal width is halved, so you get resolutions like 320x480, 400x600, and 512x768. Because each dot is spread over two actual pixels, the display will be darker than in a normal video mode. Any bitmap data will obviously need converting to the correct 12 bit format: regular 15 or 16 bit images won't display correctly... Although this works like a truecolor mode, it is actually using a 256 color palette, so palette fades are still possible! This code only works in linear screen modes (don't try Mode-X). SEE ALSO
BITMAP(3alleg4), END_OF_MAIN(3alleg4), MATRIX(3alleg4), PALETTE(3alleg4), RGB(3alleg4), allegro_error(3alleg4), allegro_init(3alleg4), allegro_message(3alleg4), apply_matrix(3alleg4), blit(3alleg4), circle(3alleg4), clear_bitmap(3alleg4), clear_keybuf(3alleg4), clear_to_color(3alleg4), create_bitmap(3alleg4), create_bitmap_ex(3alleg4), destroy_bitmap(3alleg4), ellipsefill(3alleg4), fade_out(3alleg4), fixcos(3alleg4), fixed(3alleg4), fixsin(3alleg4), fixtoi(3alleg4), font(3alleg4), get_rotation_matrix(3alleg4), get- pixel(3alleg4), install_keyboard(3alleg4), itofix(3alleg4), keypressed(3alleg4), line(3alleg4), makecol(3alleg4), masked_blit(3alleg4), putpixel(3alleg4), screen(3alleg4), set_clip_rect(3alleg4), set_color(3alleg4), set_gfx_mode(3alleg4), set_palette(3alleg4), text_height(3alleg4), text_length(3alleg4), textout_ex(3alleg4), textprintf_ex(3alleg4) Allegro version 4.4.2 ex12bit(3alleg4)
All times are GMT -4. The time now is 07:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy