05-14-2008
Help to process each line in a file...
Hi all,
I am storing all the fil names from a directory into a file "filenames.txt" like using awk and cut commands
base/src/file1.sc
base/src/file2.sc
base/src/file3.sc
base/src/file4.sc
base/src/file5.sc
base/src/file6.sc
base/src/file7.sc
base/src/file8.sc
base/src/file9.sc
and then I need to pick the 1st line from this file and need to grep for a particular pattern inside this and need to continue till the last record in file "filenames.txt", but I am stuck not knowing how to process each record from this file "filenames.txt"... I appreciate your effort in helping me..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
2. UNIX for Dummies Questions & Answers
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
3. Shell Programming and Scripting
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
4. Shell Programming and Scripting
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
5. Shell Programming and Scripting
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
6. Shell Programming and Scripting
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
7. Shell Programming and Scripting
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
8. Shell Programming and Scripting
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
9. Shell Programming and Scripting
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
10. Shell Programming and Scripting
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
LEARN ABOUT SUNOS
mlib_signalemphasize_s16s_s16s_sat
mlib_SignalEmphasize_S16_S16_Sat(3MLIB) mediaLib Library Functions mlib_SignalEmphasize_S16_S16_Sat(3MLIB)
NAME
mlib_SignalEmphasize_S16_S16_Sat, mlib_SignalEmphasize_S16S_S16S_Sat, mlib_SignalEmphasize_F32_F32, mlib_SignalEmphasize_F32S_F32S - signal
pre-emphasizing
SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ]
#include <mlib.h>
mlib_status mlib_SignalEmphasize_S16_S16_Sat(mlib_s16 *dst, const mlib_s16 *src, void *filter, mlib_s32 n);
mlib_status mlib_SignalEmphasize_S16S_S16S_Sat(mlib_s16 *dst, const mlib_s16 *src, void *filter, mlib_s32 n);
mlib_status mlib_SignalEmphasize_F32_F32(mlib_f32 *dst, const mlib_f32 *src, void *filter, mlib_s32 n);
mlib_status mlib_SignalEmphasize_F32S_F32S(mlib_f32 *dst, const mlib_f32 *src, void *filter, mlib_s32 n);
DESCRIPTION
Each of these functions applies the preemphasizer to one signal packet and updates the filter states.
For monaural signals, the following equation is used:
dst[i] = src[i] - alpha*src[i - 1]
where i = 0, 1, ..., (n - 1); src[-1] = 0.
For stereo signals, the following equation is used:
dst[2*i] = src[2*i] - alpha*src[2*(i - 1)]
dst[2*i + 1] = src[2*i + 1] - alpha*src[2*(i - 1) + 1]
where i = 0, 1, ..., (n - 1); src[-2] = src[-1] = 0.
PARAMETERS
Each of the functions takes the following arguments:
dst Destination signal array.
src Source signal array.
filter Internal filter structure.
n Number of samples in the source signal array.
RETURN VALUES
Each of the functions 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 |Evolving |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO
mlib_SignalEmphasizeFree_S16_S16(3MLIB), mlib_SignalEmphasizeInit_S16_S16(3MLIB), attributes(5)
SunOS 5.10 10 Nov 2004 mlib_SignalEmphasize_S16_S16_Sat(3MLIB)