Sponsored Content
Top Forums Shell Programming and Scripting awk script -print line when $2 > $2 of previous line Post 302775987 by gafoleyo73 on Tuesday 5th of March 2013 08:00:14 PM
Old 03-05-2013
Works beautifully thank you!!
-man that was fast!!!

... my sample output was wrong sorry. My mistake. Your code nailed it though. Cheers!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk;sed appending line to previous line....

I know this has been asked before but I just can't parse the syntax as explained. I have a set of files that has user information spread out over two lines that I wish to merge into one: User1NameLast User1NameFirst User1Address E-Mail:User1email User2NameLast User2NameFirst User2Address... (11 Replies)
Discussion started by: walkerwheeler
11 Replies

2. Shell Programming and Scripting

how Print previous line ..........

HELLO...I wanted to ask you, than sure know unix more than me, as I can obtain the following solution: I have a file with rows of the type: CIAO COME STAI PERCHE COME STAI CIAO COME VA ALLO CHE FACCIAMO ................. I would that if in a line is present the word (for example) " CHE... (9 Replies)
Discussion started by: fabi20
9 Replies

3. Shell Programming and Scripting

Awk script to create new file based on previous line

Need help creating a script that does the following: Sort a file Compare the previous line "last field" with current line "last field" If they are the same, print output to a file If they are different print output to a new file The script should keep creating new files if the previous... (5 Replies)
Discussion started by: Muga801
5 Replies

4. Shell Programming and Scripting

Print the previous line

My requirement is that when ever search criteria matchs in log file, the previous line just above the search word as well as search word should be print. sample log file --03-19T11:26 xxx create version "a.sh@@/main/6" "104157 " --03-18T16:01 xxx create version "a.sh@@/main/5" ... (6 Replies)
Discussion started by: jadoo_c2
6 Replies

5. Shell Programming and Scripting

awk get matched line's previous line

hi everyone, a b in c d e f in g output is: a e so awk search for "in", then print out the matched line's previuos line. Please advice. (11 Replies)
Discussion started by: jimmy_y
11 Replies

6. UNIX for Dummies Questions & Answers

Awk to print data from current and previous line

Hi guys, I have found your forum super useful. However, right now I am stuck on a seemingly "simple" thing in AWK. I have two columns of data, the first column in Age (in million years) and the second column is Convergence Rate (in mm/yr). I am trying to process my data so I can use it to... (2 Replies)
Discussion started by: awk_noob_456
2 Replies

7. Shell Programming and Scripting

Print a field from the previous line

plz help me!! I have this file , 3408 5600 3796 6035 4200 6285 4676 0 40 1554 200 1998 652 2451 864 2728 1200 0 I want it like if $2==0,replace it with field from the previous line+500 say here the o/p would be like 3408 5600 3796 6035 4200 6285... (16 Replies)
Discussion started by: Indra2011
16 Replies

8. Shell Programming and Scripting

How to print previous line of multiple pattern matched line?

Hello, I have below format log file, Comparing csv_converted_files/2201/9747.1012H67126.5077292103609547345.csv and csv_converted_files/22019/97447.1012H67126.5077292103609547345.csv Comparing csv_converted_files/2559/9447.1012H67126.5077292103609547345.csv and... (6 Replies)
Discussion started by: arvindshukla81
6 Replies

9. AIX

Print nth previous line after match

Please help me print nth line after match awk or sed one line command. (3 Replies)
Discussion started by: sushma123
3 Replies

10. UNIX for Beginners Questions & Answers

awk or sed to print the character from the previous line after the regexp match

Hi All, I need to print the characters in the previous line just before the regular expression match Please have a look at the input file as attached I need to match the regular expression ^ with the character of the previous like and also the pin numbers and the output file should be like... (6 Replies)
Discussion started by: kshitij
6 Replies
aylet(1)							  Music Software							  aylet(1)

NAME
aylet, xaylet - play Spectrum `.ay' music files SYNOPSIS
aylet/xaylet [-BehlmnNsS] [-A stopafter] [-F fadetime] [-t tracknum] [file1 [file2 ... ]] DESCRIPTION
aylet plays music files in the `.ay' format. These files are essentially wrappers around bits of Z80 code which play music on the Sinclair ZX Spectrum 128's sound hardware - the beeper, or the AY-3-8912 sound chip, or both. Files using the Amstrad CPC ports are also supported. `aylet' has a curses-based interface, and `xaylet' has an X-based one. OPTIONS
-A set stop-after time in seconds (this is the time at which tracks start fading out), or 0 to disable fading. The default is 180 sec- onds (3 minutes). -B use `ABC' stereo positions, rather than the default `ACB'. ACB effectively pushes channels A and B to the left and right (using a stereo delay), with C remaining central; ABC puts A and C to the left/right instead, leaving B central. -e force 8-bit playback, even if 16-bit is available. -F set fade-out time in seconds (the time tracks take to fade out). The default is 10 seconds. -h give terse usage help. -l list the contents of files (track names etc.) rather than playing them. -m use mono rather than the default stereo playback. -n rather than the usual interface, use a simple batch-playing tty style, a bit like mpg123. (Only works in the curses version.) -N use `narrow' stereo separation (so the channels sound closer together) rather than the default `wide' separation. -s output sample data to stdout rather than playing it; implies `-n'. The sample is 44.1kHz 16-bit stereo (or mono if using `-m'). Don't be surprised if the sample takes a little while to generate, as it still has to emulate the Z80. -S apply a pseudo-stereo effect to the beeper output. Works well in some cases, but can make things sound a bit shaky (or rather, more so than usual :-)). -t play only the specified track, then exit. (Strictly speaking, it starts playing the given track, and exits when any track fades out.) Mainly useful when playing a single file non-interactively. file1 etc. the file(s) to play. Currently these can only be specified on the command-line. BEHIND THE SCENES
The way aylet works may seem a little strange if you're not familiar with how the `.ay' format goes about things, so here's some background on how it all works. As mentioned above, the files basically contain chunks of machine code to run on an emulated Z80 with certain sound hardware. Since you're just running a program, you can't really fast-forward or rewind as such, but you can move between tracks specified in the file. (Some files only have one, but others have several.) The whole just-running-a-program thing leads to two other problems, too. You can't tell where a track ends, other than to see when the sound stops; what aylet does is to exit a track after 4 seconds of total silence. And a track may never end at all; aylet fades it out after 3 minutes by default. (Yes, 3 minutes be may too soon to allow some tracks to `finish', but you have to strike the balance somewhere, and it's only a default. Use `-A' or press `s' to change it.) KEYS
Both the curses-based and X-based interfaces use these keys (some of which are based on those used by XMMS): q or Esc exit the program. z previous track. x play. c pause. v stop. b next track. r restart track. Backspace or Delete previous file. Space next file. s increase stop-after time. S decrease stop-after time. Setting it to zero disables fading completely. f increase fade-out time. F decrease fade-out time. h enable/disable high-speed mode, playing four times as fast when enabled (in a way), as a sort of substitute for a real fast-forward control. In xaylet, you can also use the matching buttons for most of the above. When using `aylet -n', the interactivity is scaled down dramatically, leaving just the one control: Ctrl-C if the current track has been playing for less than half a second, exit the program; otherwise, skip to the next track. Note that the key used to do this is really whatever you have set up to generate a SIGINT signal, but it's generally Ctrl-C. EXAMPLES
To play all .ay files in the current directory: aylet *.ay or xaylet *.ay To convert ysfollin.ay to a mono sample in .wav format (requires `sox'): aylet -sm ysfollin.ay |sox -r 44100 -t sw - tune.wav BUGS
The AY is probably too loud relative to the beeper. This may be fixed in the next version, though it's more likely to be an option to choose between the current more reasonable balance and the real thing. :-) Several options which it could reasonably allow to be changed at runtime (e.g. AY stereo, beeper stereo, ACB vs. ABC) can't be at the moment. The X version is currently a bit too much like the curses one, at the expense of GUIness in some respects. SEE ALSO
fuse(1) AUTHOR
Russell Marks (rus@svgalib.org). The Z80 emulation was written by Ian Collier, for xz80. Chris Cox wrote the OpenBSD sound code. Matan Ziv-Av was partly responsible for the OSS sound code. Version 0.4 1st October, 2004 aylet(1)
All times are GMT -4. The time now is 03:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy