11-15-2011
Quote:
Originally Posted by
srattani
Hello vergesh99,
Thanks for clarification, I now understand sr.awk means a separate source file.
I am trying to understand the code. So basically you look for the word "Currency" and you stop on the next line after you have found "Currency", correct?
correct. we find 'Currency' and set a flag 'f' to be positive (!=0)
Quote:
Then you split the line but Quick question what is "f" and what does "f++" and "f--" mean? Move one line forward or one line backward?
if 'f' is positive (!=0) execute the following code (within {}). Once done, reset 'f' to 0 so that we don't execute the same block of code the follwing lines.
Quote:
Really appreciate your help and time!
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
My file in ksh consists of message data of varying lengths (lines), separated with headers.
I would like to find a string from this file, and print out the whole message data including the headers.
my plan of attack is to search the strings, print the top header, and print the whole message... (2 Replies)
Discussion started by: apalex
2 Replies
2. Shell Programming and Scripting
Dear All ,
I am posting first time in this forum . Please ignore my mistakes .
I am learning Unix and i need help to extract specific data from file .
1. I want to grep number of fails from log . The file contains "fails" word in line if test cases are failed .
2. The log contains... (20 Replies)
Discussion started by: getdpg
20 Replies
3. Shell Programming and Scripting
Hello again, how do you extract data from a file? I have created a file with PID #s in it, I need to be able to take the PID from each line and kill it. How is this done? (4 Replies)
Discussion started by: raidzero
4 Replies
4. Shell Programming and Scripting
I m new to shell scripting & i need a help....
i have file like....
Name := sachin
address:=something
phone:=111
...
Note: There might be or not space between Name & := and between := & sachin. I need to extract the data from each line of file as
var1=Name
value1=sachin
same for... (13 Replies)
Discussion started by: ps_sach
13 Replies
5. Shell Programming and Scripting
I need to create a script to extract some specific data from a file. I locate the file using the find command:
find . -name "rpbol*" -print | xargs grep -li
Once I locate the file I need using the above command, I would like to extract some data from that file. The data is always located... (2 Replies)
Discussion started by: jevaba
2 Replies
6. Shell Programming and Scripting
My input file:
data_5 Ali 422 2.00E-45 102/253 140/253 24
data_3 Abu 202 60.00E-45 12/23 140/23 28
data_1 Ahmad 256 7.00E-45 120/235 140/235 22
data_4 Aman 365 8.00E-45 15/65 140/65 20
data_10 Jones 869 9.00E-45 65/253 140/253 18... (12 Replies)
Discussion started by: patrick87
12 Replies
7. Shell Programming and Scripting
Hi, Great minds, I have some files, in fact header files, of CTD profiler, I tried a lot C programming, could not get output as I was expected, because my programming skills are very poor, finally, joined unix forum with the hope that, I may get what I want, from you people,
Here I have attached... (17 Replies)
Discussion started by: nex_asp
17 Replies
8. Shell Programming and Scripting
Hello All,
I have a small xml file which looks like below:
<Check:defaultval Val="crash" value="crash_report_0013
generate_check_0020 generate_check_0022

This is where the fault is."/>
<Check:defaultval Val="crash" value="crash_report_1001
generate_check_1001... (9 Replies)
Discussion started by: suvendu4urs
9 Replies
9. Shell Programming and Scripting
I have a text file that contains the following data. For example, aa.txt has some numbers. I need to extract the continuous numbers(minimum 3 numbers) from it.How can I do this with awk?
>aa.txt
31
35
36
37
38
39
44
169
170
173
174
175
177
206
>1a.txt
39 (5 Replies)
Discussion started by: rahmanabdulla
5 Replies
10. Shell Programming and Scripting
Hi ,
I am having a file which is PIPE delimited like this :
file.txt
aus|start|10:00:00
nz|start|11:00:00
aus|end|10:10:00
us|start|10:00:00
nz|end|11:10:00
us|end|11:00:00
.
.
.
I want to extract an output file like this based on start time and end time for each countries: (9 Replies)
Discussion started by: rohit_shinez
9 Replies
scroll(3NCURSES) scroll(3NCURSES)
NAME
scroll, scrl, wscrl - scroll a curses window
SYNOPSIS
#include <curses.h>
int scroll(WINDOW *win);
int scrl(int n);
int wscrl(WINDOW *win, int n);
DESCRIPTION
The scroll routine scrolls the window up one line. This involves moving the lines in the window data structure. As an optimization, if
the scrolling region of the window is the entire screen, the physical screen may be scrolled at the same time.
For positive n, the scrl and wscrl routines scroll the window up n lines (line i+n becomes i); otherwise scroll the window down n lines.
This involves moving the lines in the window character image structure. The current cursor position is not changed.
For these functions to work, scrolling must be enabled via scrollok.
RETURN VALUE
These routines return ERR upon failure, and OK (SVr4 only specifies "an integer value other than ERR") upon successful completion.
X/Open defines no error conditions.
This implementation returns an error if the window pointer is null, or if scrolling is not enabled in the window, e.g., with scrollok.
NOTES
Note that scrl and scroll may be macros.
The SVr4 documentation says that the optimization of physically scrolling immediately if the scroll region is the entire screen "is" per-
formed, not "may be" performed. This implementation deliberately does not guarantee that this will occur, to leave open the possibility of
smarter optimization of multiple scroll actions on the next update.
Neither the SVr4 nor the XSI documentation specify whether the current attribute or current color-pair of blanks generated by the scroll
function is zeroed. Under this implementation it is.
PORTABILITY
The XSI Curses standard, Issue 4 describes these functions.
SEE ALSO
ncurses(3NCURSES), outopts(3NCURSES)
scroll(3NCURSES)