Sponsored Content
Top Forums UNIX for Dummies Questions & Answers single output of awk script processing multiple files Post 302342584 by Kasimir on Monday 10th of August 2009 09:26:44 AM
Old 08-10-2009
There is just one more problem:

Every input file is not to be read completely - only up to the position of the appearance of a certain string. Once this string is read, awk should stop processing the current file and start on the next one, until all input-files are processed.

My idea was something like this:

if ($1=="exit_string)
"go to the next input_file"

If all input files are read, exit.

My problem is, that I don't know how I could realize the "go to the next input_file" command. If I would just use the exit command, instead of the "go to next file", awk would quit after reading the first input file.

Does anybody have an idea?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help needed in processing multiple variables in a single sed command.

Is it possible to process multiple variables in a single sed command? I have the following ksh with three variables and I want to search for all variables which start with "var" inside input.txt. I tired "$var$" but it just prints out everyting in input.txt and does not work. $ more test.ksh... (5 Replies)
Discussion started by: stevefox
5 Replies

2. Shell Programming and Scripting

awk, perl Script for processing a single line text file

I need a script to process a huge single line text file: The sample of the text is: "forward_inline_item": "Inline", "options_region_Australia": "Australia", "server_event_err_msg": "There was an error attempting to save", "Token": "Yes", "family": "Family","pwd_login_tab": "Enter Your... (1 Reply)
Discussion started by: hmsadiq
1 Replies

3. Shell Programming and Scripting

Writing output into different files while processing file using AWK

Hi, I am trying to do the following using AWK program. 1. Read the input data file 2. Parse the record and see if it contains errors 3. If the record contains errors, then write it into Reject file, else, write into usual output file or display it on the screen Here is what I have done -... (6 Replies)
Discussion started by: vidyak
6 Replies

4. Shell Programming and Scripting

awk script processing data from 2 files

Hi! I have 2 files containing data that I need to process at the same time, I have problems in reading a different number of lines from the different files. Here is an explanation of what I need to do (possibly with an awk script). File "samples.txt" contains data in the format: time_instant... (6 Replies)
Discussion started by: Alice236
6 Replies

5. UNIX for Dummies Questions & Answers

Using AWK: Extract data from multiple files and output to multiple new files

Hi, I'd like to process multiple files. For example: file1.txt file2.txt file3.txt Each file contains several lines of data. I want to extract a piece of data and output it to a new file. file1.txt ----> newfile1.txt file2.txt ----> newfile2.txt file3.txt ----> newfile3.txt Here is... (3 Replies)
Discussion started by: Liverpaul09
3 Replies

6. Shell Programming and Scripting

awk, multiple files input and multiple files output

Hi! I'm new in awk and I need some help. I have a folder with a lot of files and I need that awk do something in each file and print a new file with the output. The input file name should be modified when I print the outpu files. Thanks in advance for help! :-) ciao (5 Replies)
Discussion started by: gabrysfe
5 Replies

7. Shell Programming and Scripting

Processing multiple files awk

hai i need my single awk script to act on 4 trace files of ns2 and to calculate througput and it should print result from each trace file in a single trace file. i tried with the following code but it doesnt work awk -f awkscript inputfile1 inputfile2 inputfile3 inputfile4>outputfile ... (4 Replies)
Discussion started by: sarathyy
4 Replies

8. Shell Programming and Scripting

Combining columns from multiple files into one single output file

Hi, I have 3 files with one column value as shown File: a.txt ------------ Data_a1 Data_a2 File2: b.txt ------------ Data_b1 Data_b2 Data_b3 Data_b4 File3: c.txt ------------ Data_c1 Data_c2 Data_c3 Data_c4 Data_c5 (6 Replies)
Discussion started by: vfrg
6 Replies

9. Shell Programming and Scripting

Using a single "find" cmd to search for multiple file types and output individual files

Hi All, I am new here but I have a scripting question that I can't seem to figure out with the "find" cmd. What I am trying to do is to only have to run a single find cmd parsing the directories and output the different file types to induvidual files and I have been running into problems.... (3 Replies)
Discussion started by: swaters
3 Replies

10. Shell Programming and Scripting

Passing multiple files to awk for processing in bash script

Hi, I'm using awk command in bash script. I'm able to pass multiple files to awk for processing.The code i can use is as below(sample code) #!/bin/bash awk -F "," 'BEGIN { ... ... ... }' file1 file2 file3 In the above code i'm passing the file names manually and it is fine till my... (7 Replies)
Discussion started by: shree11
7 Replies
SPEEXENC(1)							   User Commands						       SPEEXENC(1)

NAME
speexenc - The reference implementation speex encoder. SYNOPSIS
speexenc [options] input_file output_file DESCRIPTION
Encodes input_file using Speex. It can read the WAV or raw files. input_file can be: filename.wav wav file filename.* Raw PCM file (any extension other than .wav) - stdin output_file can be: filename.spx Speex file - stdout OPTIONS
-n, --narrowband Narrowband (8 kHz) input file -w, --wideband Wideband (16 kHz) input file -u, --ultra-wideband "Ultra-wideband" (32 kHz) input file --quality n Encoding quality (0-10), default 8 --bitrate n Encoding bit-rate (use bit-rate n or lower) --vbr Enable variable bit-rate (VBR) --abr rate Enable average bit-rate (ABR) at rate bps --vad Enable voice activity detection (VAD) --dtx Enable file-based discontinuous transmission (DTX) --comp n Set encoding complexity (0-10), default 3 --nframes n Number of frames per Ogg packet (1-10), default 1 --comment Add the given string as an extra comment. This may be used multiple times --author Author of this track --title Title for this track -h, --help This help -v, --version Version information -V Verbose mode (show bit-rate) Raw input options: --rate n Sampling rate for raw input --stereo Consider raw input as stereo --le Raw input is little-endian --be Raw input is big-endian --8bit Raw input is 8-bit unsigned --16bit Raw input is 16-bit signed Default raw PCM input is 16-bit, little-endian, mono More information is available from the Speex site: http://www.speex.org Please report bugs to the mailing list `speex-dev@xiph.org'. COPYRIGHT
Copyright (C) 2002 Jean-Marc Valin speexenc version 1.1 September 2003 SPEEXENC(1)
All times are GMT -4. The time now is 02:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy