Help to process each line in a file...


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Help to process each line in a file...
# 8  
Old 05-14-2008
Thanks era and boddu Smilie, am able to achieve what I really wanted using xargs grep pattern<filenames.txt, Thanks a lot.....
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Process a file for line count using for loop in awk

Hi, I have a file with contents So what I have to do is In short, break the file after every 6 lines and then truncate new line to tab for these 6 lines. I am not able to execute the for loop in awk properly. The idea is something like this: less file| awk '{for .... {if ((nr>=1)... (7 Replies)
Discussion started by: rossi
7 Replies

2. Shell Programming and Scripting

Bash script to read a file from particular line till required line and process

Hi All, Am trying to write wrapper shell/bash script on a utility tool for which i need to pass 2 files as arugment to execute utility tool. Wraper script am trying is to do with above metion 2 files. utility tool accepts : a. userinfo file : which contains username b. item file : which... (2 Replies)
Discussion started by: Optimus81
2 Replies

3. Shell Programming and Scripting

How to process only new line of tail -f command from live log file?

Hi, I want to read a live log file line by line and considering those line which are newly added to file Below code I am using, which read line but as soon as it read new line from log file its starts processing from very first line of file. tail -F /logs/COMMON-ERROR.log | while read... (11 Replies)
Discussion started by: ketanraut
11 Replies

4. Shell Programming and Scripting

Help to process line by line and assign value to variables

Hi, there I have a file with tab and space as field separator. I need to assign values to variables then work with them, line by line. The code I wrote only works when each line has only one word. It doesn't work for the current situation. for line in `cat file.txt`; do ID=`awk '{print... (4 Replies)
Discussion started by: cwzkevin
4 Replies

5. Shell Programming and Scripting

How to process log file line by line?

Greetings, I'm new to this forum, also new to shell script I have done some simple shell script before, like backup linux machine using rsync and crontab, but now I need to do some log analyzing, which is beyond my ability... so I'm going to seek for help in this forum, hope someone could give... (5 Replies)
Discussion started by: lunaticdawn
5 Replies

6. Shell Programming and Scripting

Shell script to read a text file line by line & process it...

Hi , I am trying to write an shell, which reads a text file (from a location) having a list of numbers of strictly 5 digits only ex: 33144 Now my script will check : 1) that each entry is only 5 digits & numeric only, no alphabets, & its not empty. 2)then it executes a shell script called... (8 Replies)
Discussion started by: new_to_shell
8 Replies

7. Shell Programming and Scripting

Read file line by line and process the line to generate another file

Hi, i have file which contains data as below(Only sample shown, it may contain more data similar to the one shown here) i need to read this file line by line and generate an output file like the one below i.e based on N value the number of MSISDNs will vary, if N=1 then the following... (14 Replies)
Discussion started by: aemunathan
14 Replies

8. Shell Programming and Scripting

How to read/process a .gz file, one line at a time?

Hello I'm stuck trying to solve this KSH issue and I'm hoping someone out there can offer some suggestions. I want to read lots of large .gz files one line at a time in order to compare its Error entries with a list of known errors. I can't simply do "foreach ERROR do gzcat *.gz |grep... (2 Replies)
Discussion started by: dayscripter
2 Replies

9. UNIX for Dummies Questions & Answers

shell script to process file line by line

Hi , I am new to shell scripting (ksh shell) and trying to accomplish few requiremtns. I have a file with the following format EMP NO EMP NAME AGE Amt Paid 12 Mark Taylor 32 32333 14 James Brown... (5 Replies)
Discussion started by: royalsing
5 Replies

10. Shell Programming and Scripting

Process file line by line

Hi I have a csv file as follows 608, Barnwood PFS,,2 150, Barnwood CS,2,4 etc When i do for lines in `cat file.dat` the space in second argument seems to screwing the lines up. Any suggestions to get around this? Thanks (5 Replies)
Discussion started by: handak9
5 Replies
Login or Register to Ask a Question
mlib_ImageDivAlpha(3MLIB)				    mediaLib Library Functions					 mlib_ImageDivAlpha(3MLIB)

NAME
mlib_ImageDivAlpha - alpha channel division SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ] #include <mlib.h> mlib_status mlib_ImageDivAlpha(mlib_image *dst, const mlib_image *src, mlib_s32 cmask); DESCRIPTION
The mlib_ImageDivAlpha() function divides color channels by the alpha channel on a pixel-by-pixel basis. For the MLIB_BYTE image, it uses the following equation: dst[x][y][c] = src[x][y][c] / (src[x][y][a] * 2**(-8)) For the MLIB_SHORT image, it uses the following equation: dst[x][y][c] = src[x][y][c] / (src[x][y][a] * 2**(-15)) For the MLIB_USHORT image, it uses the following equation: dst[x][y][c] = src[x][y][c] / (src[x][y][a] * 2**(-16)) For the MLIB_INT image, it uses the following equation: dst[x][y][c] = src[x][y][c] / (src[x][y][a] * 2**(-31)) where c and a are the indices for the color channels and the alpha channel, respectively, so c != a. In the case of src[x][y][a] = 0, dst[x][y][c] = 0 if src[x][y][c] = 0 dst[x][y][c] = DATA_TYPE_MAX if src[x][y][c] > 0 dst[x][y][c] = DATA_TYPE_MIN if src[x][y][c] < 0 where DATA_TYPE is MLIB_U8, MLIB_S16, MLIB_U16, or MLIB_S32 for an image of type MLIB_BYTE, MLIB_SHORT, MLIB_USHORT, or MLIB_INT, respec- tively. PARAMETERS
The function takes the following arguments: dst Pointer to destination image. src Pointer to source image. cmask Channel mask to indicate the alpha channel. Each bit of the mask represents a channel in the image. The channel corresponding to the 1 bit of cmask is the alpha channel. RETURN VALUES
The function returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
mlib_ImageDivAlpha_Inp(3MLIB), mlib_ImageDivAlpha_Fp(3MLIB), mlib_ImageDivAlpha_Fp_Inp(3MLIB), attributes(5) SunOS 5.11 2 Mar 2007 mlib_ImageDivAlpha(3MLIB)