02-21-2007
Ganesh,
I'm sure that would be better solution that what I have below:
---------------------------------------------------------
while true
do
read record
if [ "$record" = "" ]
then
break
fi
echo $record >> ./outputfile
echo $record >> ./outputfile
echo $record >> ./outputfile
done < ./inputfile
### if the file name has to be changed :
rm ./inputfile
mv outputfile inputfile
--------------------------------------------------------------
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all:
Let's suppose I have a file like this (but with many more records).
XX ME 342 8688 2006 7 6 3c 60.029 -38.568 2901 0001 74 4 7603 8
969.8 958.4 3.6320 34.8630
985.5 973.9 3.6130 34.8600
998.7 986.9 3.6070 34.8610
1003.6 991.7 ... (4 Replies)
Discussion started by: rleal
4 Replies
2. Shell Programming and Scripting
I have a .DAT file like below
23666483030000653-B94030001OLFXXX000000120081227
23797049900000654-E71060001OLFXXX000000220081227
23699281320000655 E71060002OLFXXX000000320081227
22885068900000652 B86860003OLFXXX592123320081227
22885068900000652 B86860003ODL-SP592123420081227... (8 Replies)
Discussion started by: kshuser
8 Replies
3. Shell Programming and Scripting
Hi frinds,
Need your help.
item , color ,desc
==== ======= ====
1,red ,abc
1,red , a b c
2,blue,x
3,black,y
4,brown,xv
4,brown,x v
4,brown, x v
I have to elemnet the duplicate rows on the basis of item.
the final out put will be
1,red ,abc (6 Replies)
Discussion started by: imipsita.rath
6 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I have a file with these records
abc
xyz
xyz
pqr
uvw
cde
cde
In my o/p file , I want all the non duplicate rows to be shown.
o/p abc
pqr
uvw
Any suggestions how to do this?
Thanks for the help.
rs (2 Replies)
Discussion started by: rs123
2 Replies
5. UNIX for Dummies Questions & Answers
Consider my input is
10
10
20
then,
uniq -u will give 20 and uniq -dwill return 10.
But i need the output as ,
10
10
How we can achieve this?
Thanks (4 Replies)
Discussion started by: pandeesh
4 Replies
6. Shell Programming and Scripting
I have 2 files
"File 1" is delimited by ";" and "File 2" is delimited by "|".
File 1 below (3 record shown):
Doc1;03/01/2012;New York;6 Main Street;Mr. Smith 1;Mr. Jones
Doc2;03/01/2012;Syracuse;876 Broadway;John Davis;Barbara Lull
Doc3;03/01/2012;Buffalo;779 Old Windy Road;Charles... (2 Replies)
Discussion started by: vestport
2 Replies
7. Shell Programming and Scripting
Hi,
i am working on a script that would remove records or lines in a flat file. The only difference in the file is the "NOT NULL" word. Please see below example of the input file.
INPUT FILE:>
CREATE a
(
TRIAL_CLIENT NOT NULL VARCHAR2(60),
TRIAL_FUND NOT NULL... (3 Replies)
Discussion started by: reignangel2003
3 Replies
8. Shell Programming and Scripting
Gents,
Please how I can get only the last 2 records from repetead values, from column 2
input
1 1011
1 1011
1 1012
1 1012
1 5001
1 5001
1 5002
1 5002
1 5003
1 5003
1 7001
1 7001
1 7002
1 7002 (2 Replies)
Discussion started by: jiam912
2 Replies
9. Shell Programming and Scripting
Gents,
I have a file which contends duplicate records in column 1, but the values in column 2 are different.
3099753489 3
3099753489 5
3101954341 12
3101954341 14
3102153285 3
3102153285 5
3102153297 3
3102153297 5
I will like to get something like this:
output desired... (16 Replies)
Discussion started by: jiam912
16 Replies
10. Shell Programming and Scripting
Gents,
Please give a help
file
--BAD STATUS NOT RESHOOTED--
*** VP 41255/51341 in sw 2973
*** VP 41679/51521 in sw 2973
*** VP 41687/51653 in sw 2973
*** VP 41719/51629 in sw 2976
--BAD COG NOT RESHOOTED--
*** VP 41689/51497 in sw 2974
*** VP 41699/51677 in sw 2974
*** VP... (18 Replies)
Discussion started by: jiam912
18 Replies
LEARN ABOUT DEBIAN
numm.one-bit-instrument
one-bit-instrument(7) Numm Tutorials one-bit-instrument(7)
NAME
one bit instrument - how to make a gnarly synth with numm-run
SYNOPSIS
numm-run FILE
DESCRIPTION
In this tutorial we will learn how to live-code a one-bit synthesizer controlled by mouse position. It is intended as a gentle introduc-
tion to development with numm-run.
To get started, create a text file with the following method stubs:
def audio_out(a):
pass
def video_out(a):
pass
Save the file as onebit.py, and then launch it with numm-run:
numm-run onebit.py
You should see a blank window appear. We will now make some sound and light by changing the value of a in the audio_out and video_out
functions:
def audio_out(a):
a[::100] = 2**15
def video_out(a):
a.flat[::100] = 255
Save the file, and you should see and hear the sketch update. This is using numpy's array-indexing to turn every hundredth audio sample
and pixel-color on. The audio sample rate is by default 44100Hz, so it produces a series of clicks that will be perceived as a 441Hz tone.
We can turn this into an instrument by connecting mouse motion to frequency:
period = 100
def audio_out(a):
a[::period] = 2**15
def video_out(a):
a.flat[::period] = 255
def mouse_in(type,px,py,button):
global period
period = px*1000
Finally, let's use the keyboard to record and jump to notes. The first time you press a key, it records the period, and subsequant depres-
sions play the saved period:
period = 100
record = {}
def audio_out(a):
a[::period] = 2**15
def video_out(a):
a.flat[::period] = 255
def mouse_in(type,px,py,button):
global period
period = px*1000
def keyboard_in(type,key):
global period
if record.has_key(key):
period = record[key]
elif record.has_key(key):
record[] = period
SEE ALSO
numm-run(1), numm.getting-started(7), numm.spectral-analysis(7)
numm February 2012 one-bit-instrument(7)