Sponsored Content
Top Forums Shell Programming and Scripting need a logic to start with awk/ sh Post 302230885 by user_prady on Monday 1st of September 2008 12:59:24 AM
Old 09-01-2008
Quote:
Originally Posted by Annihilannic
Should the data always be received in the order it was sent? If so, try this:

Code:
awk '/TX/ { print $NF }' datafile > sent
awk '/RX/ { print $NF }' datafile > received
diff sent received

Thanks for your reply..& Sorry If I misguided you..

No its not like that data is not recevied until unless I specify to read exclusively . Think of as a RAM( Read access Memory)

I writes to RAM by specifing TXADDR & TXDATA and I retrives the data when I specify that address with RXADDR , I get RXDATA ie, last written on that addresss.


Actually Wrrtting and reading are independent of each other.

Once I give TXADDR & TXDATA (5 burst - In INPUT FILE you can see five lines of input data contineously). Then after that I am going to Read those values when RXADDR comes ..

Suppose I am writting to the same address twice then reading from that address then it ll read the lastest value that is written to that address.

Thanks
user_prady

Last edited by user_prady; 09-01-2008 at 02:09 AM..
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

cannot get logic for concatenation awk

Hello friends, I have a problem in printing an array.. Example if my array line contains 4 elements like following line=0002 , line=202200, line=200002, line= 300313 Now one = sprintf line line line line will concatenate my whole array to one. But I am not sure about the... (7 Replies)
Discussion started by: user_prady
7 Replies

2. Shell Programming and Scripting

need a logic for awk programming

Hello Friends, I have a txt file like below //*Init Start Reg(read,12'h42E,16'h0000); Nop(5628.5); //*Init End //*Main Start Reg(read,12'h42E,16'h0000); Nop(5628.5); //*Main End I want to calculate the values between //* Init Start & //* Init End And //*Main Start & //*Main... (5 Replies)
Discussion started by: user_prady
5 Replies

3. Shell Programming and Scripting

Help with awk logic

I want to print lines that have "IND" or "ind" or nothing in field 2 or 3 file: output needed: Code i wrote: nawk -F"," '{if(tolower($2||$3) ~"ind"||"")print}' file Help is appreciated (3 Replies)
Discussion started by: pinnacle
3 Replies

4. Shell Programming and Scripting

need an awk script/logic

In one data file i have values like this a b c 1 2 e f g 2 3 i j k 3 5 I need to sum up the last 2 columns and make a data file...How i can do that. a b c 1 2 e f g 2 3 i j k 3 5... (8 Replies)
Discussion started by: bobprabhu
8 Replies

5. UNIX for Dummies Questions & Answers

Need help in logic using awk command

I have task to find out the min,max, average value of each service for example i searched for " StatementService " $awk '/VST.*StatementService:/{print $3,$4,$19,$22,$25}' performance.log > smp.log $cat smp.log amexgtv VST: : StatementService:1860 StatementService:getCardReference:0... (3 Replies)
Discussion started by: senthil.ak
3 Replies

6. UNIX for Dummies Questions & Answers

awk logic and math help

Hi, My file has 2 fields and millions of lines. variableStep chrom=Uextra span=25 201 0.5952 226 0.330693 251 0.121004 276 0.0736858 301 0.0646982 326 0.0736858 401 0.2952 426 0.230693 451 0.221004 476 0.2736858 Each field either has a... (6 Replies)
Discussion started by: wyarosh
6 Replies

7. Shell Programming and Scripting

How to use this logic with awk?

Hi friends, I am having 2 files, I just want to compare 2 files each containing 2 columns 1st column is lat, and 2nd column is long, if anyone can understand below logic please help me in writing script with awk.. here each field of file2 needs to be compared with std_file main counter=0... (1 Reply)
Discussion started by: Akshay Hegde
1 Replies

8. Shell Programming and Scripting

awk logic

I am trying to check my logic on a long awk i'm using. I have about 30 checks that I built into an awk and I "believe" I did this right, but I could be wrong. awk -F\| ' $9 !~ /\/*{1,}*/ $9 ~ /\(-{4}, {2,3}/ $9 ~ /\({6}, {2,3}\)/ $9 ~ /\(\+{5}, {2,3}\)/ $9 ~ /\(\+\+{4}, {2,3}\)/ $9 ~... (8 Replies)
Discussion started by: dagamier
8 Replies
pack_fopen(3alleg4)						  Allegro manual					       pack_fopen(3alleg4)

NAME
pack_fopen - Opens a file according to mode. Allegro game programming library. SYNOPSIS
#include <allegro.h> PACKFILE *pack_fopen(const char *filename, const char *mode); DESCRIPTION
Opens a file according to mode, which may contain any of the flags: `r' - open file for reading. `w' - open file for writing, overwriting any existing data. `p' - open file in packed mode. Data will be compressed as it is written to the file, and automatically uncompressed during read opera- tions. Files created in this mode will produce garbage if they are read without this flag being set. `!' - open file for writing in normal, unpacked mode, but add the value F_NOPACK_MAGIC to the start of the file, so that it can later be opened in packed mode and Allegro will automatically detect that the data does not need to be decompressed. Instead of these flags, one of the constants F_READ, F_WRITE, F_READ_PACKED, F_WRITE_PACKED or F_WRITE_NOPACK may be used as the mode parameter. The packfile functions also understand several "magic" filenames that are used for special purposes. These are: `#' - read data that has been appended to your executable file with the exedat utility, as if it was a regular independent disk file. `filename.dat#object_name' - open a specific object from a datafile, and read from it as if it was a regular file. You can treat nested datafiles exactly like a normal directory structure, for example you could open `filename.dat#graphics/level1/mapdata'. `#object_name' - combination of the above, reading an object from a datafile that has been appended onto your executable. With these special filenames, the contents of a datafile object or appended file can be read in an identical way to a normal disk file, so any of the file access functions in Allegro (eg. load_pcx() and set_config_file()) can be used to read from them. Note that you can't write to these special files, though: the fake file is read only. Also, you must save your datafile uncompressed or with per-object compression if you are planning on loading individual objects from it (otherwise there will be an excessive amount of seeking when it is read). Finally, be aware that the special Allegro object types aren't the same format as the files you import the data from. When you import data like bitmaps or samples into the grabber, they are converted into a special Allegro-specific format, but the `#' marker file syntax reads the objects as raw binary chunks. This means that if, for example, you want to use load_pcx() to read an image from a datafile, you should import it as a binary block rather than as a BITMAP object. Example: PACKFILE *input_file; input_file = pack_fopen("scores.dat", "rp"); if (!input_file) abort_on_error("Couldn't read `scores.dat'!"); RETURN VALUE
On success, pack_fopen() returns a pointer to a PACKFILE structure, and on error it returns NULL and stores an error code in `errno'. An attempt to read a normal file in packed mode will cause `errno' to be set to EDOM. SEE ALSO
pack_fclose(3alleg4), pack_fopen_chunk(3alleg4), packfile_password(3alleg4), pack_fread(3alleg4), pack_getc(3alleg4), file_select_ex(3alleg4), pack_fopen_vtable(3alleg4), expackf(3alleg4) Allegro version 4.4.2 pack_fopen(3alleg4)
All times are GMT -4. The time now is 01:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy