03-20-2010
Help with csh, read in a file line by line
I want to process some audio with:
sox $audio1 $audio2 trim $start_time $dur
How can I batch process them by read in a file containing the values for the variables above on every line, like:
1.wav 1.5 1
2.wav 2.5 2
...
I tried "foreach f (`cat file`)" but cannot read in line by line, and I just found that these is no env variable IFS for csh. Should I use bash script?
Thank you very much
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
Although its a basic question the last 2 hours of googling and trying didnt help me to achieve what i want. Maybe some one can help me
I have a text file
text1.txt:
blablablabla
A B C
D E F
and i would like to read to read what is on position E (line 3 column 2) in a... (2 Replies)
Discussion started by: Radamez
2 Replies
2. Shell Programming and Scripting
Hi,
I have gps receiver log..its giving readings .like below
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GPSD,R=1
$GPGSV,3,1,11,08,16,328,40,11,36,127,00,28,33,283,39,20,11,165,00*71... (3 Replies)
Discussion started by: gudivada213
3 Replies
3. Shell Programming and Scripting
I am using the while-loop to read a file.
The file has lines with null-terminated strings (words, actually.)
What I have by that reading - just a first word up to '\0'!
I need to have whole string up to 'new line' - (LF, 10#10, 16#A)
What I am doing wrong?
#make file 'grb' with... (6 Replies)
Discussion started by: alex_5161
6 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
Hello, I am quite new in shell scripting and I would like to write a little scritp to run a program on some parameters files.
all my parameters files are in the same directory, so pick them up with
ls *.para >>dirafter that I have a dir file like that:
param1.para
param2.para
etc...
I... (2 Replies)
Discussion started by: shadok
2 Replies
7. Shell Programming and Scripting
Hi All,
I'm trying to figure out which are the trusted-ips and which are not using a script file.. I have a file named 'ip-list.txt' which contains some ip addresses and another file named 'trusted-ip-list.txt' which also contains some ip addresses. I want to read a line from... (4 Replies)
Discussion started by: mjavalkar
4 Replies
8. Shell Programming and Scripting
Hello,
I need a program that read a file line by line and prints out lines 1, 2 & 3 after an empty line... An example of entries in the file would be:
SRVXPAPI001 ERRO JUN24 07:28:34 1775
REASON= 0000, PROCID= #E506 #1065: TPCIPPR, INDEX= 003F
... (8 Replies)
Discussion started by: Ferocci
8 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 all,
I have a log file say Test.log that gets updated continuously and it has data in pipe separated format. A sample log file would look like:
<date1>|<data1>|<url1>|<result1>
<date2>|<data2>|<url2>|<result2>
<date3>|<data3>|<url3>|<result3>
<date4>|<data4>|<url4>|<result4>
What I... (3 Replies)
Discussion started by: pat_pramod
3 Replies
LEARN ABOUT DEBIAN
lav2wav
lav2wav(1) MJPEG tools manual lav2wav(1)
NAME
lav2wav - Extract the audio out of MJPEG container files to stdout
SYNOPSIS
lav2wav [-s num] [-c num] [-v num] [-I] [-R] [-r samplerate, bitesize, channels] lavfile1 [lavfile2 ... lavfileN]
DESCRIPTION
lav2wav can be used to extract the audio to stdout. This output goes to stdout and can be saved as a wav file or piped to another sound
processing tool that is able to handle the wav format. This can be mp2enc and toolame for mpeg layer 2 audio, or for example lame for mpeg
layer 3 audio.
The input files may be any combination of AVI (.avi), Quicktime (.qt) or editlist files so long as they are all lavtools- readable (e.g.
MJPEG-encoded AVI/Quicktime or DV type 2 AVI).
OPTIONS
lav2wav accepts the following options:
-s num
Start extracting at video frame (num)
-c num
Extract (num) frames of audio
-v num
Verbosity level (0, 1 or 2)
-I Ignore unsupported bitrates/bits per sample
-R If the file does not contain any sound. lav2wav will create silence with 44100kHz Sampelrate, 16 Bit audio bitsize and 2 Chanels
-r sr,bs,ch
If the file does not contain any sound lav2wav will generate silence with the values you supply the samplerate (sr), audio-bitsize
(bs) and channel (ch).
BUGS
The "WAV" file format (technically: RIFF) is really very much less than ideal for a tool intended to be used in pipelines as lav2wav is.
The problem is that the header includes a field specifying the length of the file. This can't be filled in except by seeking back to the
begining and over-writing. If the output is unseekable (e.g. pipe) lav2wav simply writes a large length into the header and leaves it at
that. Most tools like sox(1) or mp2enc(1) either ignore the length field anyway or only give a warning.
The audio length is inacurate calculated when lav2wav generates silence. This happens only if you have NTSC framerate and than it creates
for every hour of video 1.1498sec too less of silence.
AUTHOR
This man page was written by Bernhard Praschinger.
If you have questions, remarks, problems or you just want to contact the developers, the main mailing list for the MJPEG-tools is:
mjpeg-users@lists.sourceforge.net
For more info, see our website at
http://mjpeg.sourceforge.net
SEE ALSO
mjpegtools(1), mp2enc(1), sox(1)
MJPEG Linux Square 2 June 2001 lav2wav(1)