Sponsored Content
Full Discussion: Problem with an awk Script
Top Forums Shell Programming and Scripting Problem with an awk Script Post 302418749 by pludi on Wednesday 5th of May 2010 08:59:43 AM
Old 05-05-2010
Based on your examples:
Code:
$ cat bla.txt
RECORD s[11]
RECORD s_lt[6]
RECORD sn[9]
RECORD         f1035a[12]
SCREEN RECORD f1051b(123)
SCREEN RECORD erfass    (456)
$ perl -pe 's/^RECORD(\s+[\w_]+\[\d{1,2}\])/GRID$1/' bla.txt
GRID s[11]
GRID s_lt[6]
GRID sn[9]
RECORD         f1035a[12]
SCREEN RECORD f1051b(123)
SCREEN RECORD erfass    (456)

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk script Problem

I wrote a awk but doesnt work as expected. The Input File attached input file My awk Script /^.......*EXEC CICS /,/END-EXEC/ { if ( $0 ~ / LINK / ) { tsflag=1 } if ( $0 ~ /EXEC CICS/ && tsflag == 1 ) ... (6 Replies)
Discussion started by: pbsrinivas
6 Replies

2. Shell Programming and Scripting

Problem with one awk script

Hi , I am having a file having the contents like this file1 ##################### kite kshitij jolly admire in the wing and tell me the secret behind opus 123 and the right of the track ######################### I have to write one awk script to substitue some values with other... (6 Replies)
Discussion started by: kshitij
6 Replies

3. Shell Programming and Scripting

Problem with awk script

Hi Can anyone help me in this Problem File1 ######################### HOLI 123 AND ONE TWO THREE AMITABH SAMSUNG POLI AND TWO SENSE CRYING WING PPIN TBFLAG I B AND OROLE TB_HOT=" DCT" TB_CAT=" CAT" TC_NOT=" AND" +PIN TB=" HOT" TB_GATE=" KOT" TB_LATE=" MAT" TC=LOT MAT DAT SAT... (5 Replies)
Discussion started by: kshitij
5 Replies

4. Shell Programming and Scripting

Problem with a AWK Script

Hi I am having some contents in my file like this file1 ########################## pin (PIN1) { direction : input ; capacitance : 121 ; max_transition : 231 ; } pin (PIN2) { direction : input ; capacitance : 124 ; max_transition : 421 ;... (8 Replies)
Discussion started by: kshitij
8 Replies

5. Shell Programming and Scripting

awk script problem

Hi All, I have the following input data: That I'd like to look like this ($2 is the column I'd like it to appear in) where the entries are grouped by date: The code I have at present is: awk 'BEGIN {} { dt = $1 if (dt == dt_prev) { pp = $3 ... (7 Replies)
Discussion started by: pondlife
7 Replies

6. Shell Programming and Scripting

Problem with awk script

Hi, I have one csv file with 3 fileds like tmp1.csv 2079|2010Aug|cardilogy 2349|2010Aug|numerology 2213|2010Aug|immunlogy another csv file with code for those specialities spec.csv cardiology|CRD numerology|NMY immunology|IMY i want to replace the contents of file 1 with codes... (2 Replies)
Discussion started by: Man83Nagesh
2 Replies

7. Shell Programming and Scripting

Awk script Problem

Hi , I am having two files FILE1 and FILE2 as shown below I need to search each and every element of Coulumn1 in the FILE1 in FILE2 and Globally replace with the Corresponding element of the Column2 in the FILE2 , For example and1 which is the first element of COl 1 of the FILE1 should be... (4 Replies)
Discussion started by: jaita
4 Replies

8. Shell Programming and Scripting

problem with awk script

Hi, I have two files Hi, I have two files file1 :> Code: val="10" port="localhost:8080"httpadd="http:\\192.168.0.239" file2 :> Code: val=${val} val="pdssx" port=${port}port="1324"httpadd=${httpadd}httpadd="raamraav"fileloc=${fileloc} file3(or file2) should have following... (1 Reply)
Discussion started by: nitin.pathak
1 Replies

9. Shell Programming and Scripting

Awk Script Problem

Can someone please explain to me what is wrong with this awk script? echo 74 85 | awk '{ if ( $1 > $2 ) PRESULTS = ( $1 - $2 ); print $0,"=>","P"PRESULTS ; else if ( $1 > $2 ) NRESULTS = ( $2 - $1... (3 Replies)
Discussion started by: SkySmart
3 Replies

10. Shell Programming and Scripting

awk script problem

Hello guys i have following problem. I'm trying to copy content of one file and paste this content in all .txt files in directory, but at line 15. My script copy the content at first line, not 15. I'm confused how to do this. Thank you in advance for your help! This is my script: ARGS=2 ... (9 Replies)
Discussion started by: r00ty
9 Replies
curs_sp_funcs(3X)														 curs_sp_funcs(3X)

NAME
new_prescr - curses screen-pointer extension SYNOPSIS
#include <curses.h> int assume_default_colors_sp(SCREEN*, int, int); int baudrate_sp(SCREEN*); int beep_sp(SCREEN*); bool can_change_color_sp(SCREEN*); int cbreak_sp(SCREEN*); int color_content_sp(SCREEN*, short, short*, short*, short*); int curs_set_sp(SCREEN*, int); int define_key_sp(SCREEN*, const char *, int); int def_prog_mode_sp(SCREEN*); int def_shell_mode_sp(SCREEN*); int delay_output_sp(SCREEN*, int); int doupdate_sp(SCREEN*); int echo_sp(SCREEN*); int endwin_sp(SCREEN*); int erasechar_sp(SCREEN*); int filter_sp(SCREEN*); int flash_sp(SCREEN*); int flushinp_sp(SCREEN*); int get_escdelay_sp(SCREEN*); int getmouse_sp(SCREEN*, MEVENT*); WINDOW* getwin_sp(SCREEN*, FILE*); int halfdelay_sp(SCREEN*); bool has_colors_sp(SCREEN*); bool has_ic_sp(SCREEN*); bool has_il_sp(SCREEN*); int has_key_sp(SCREEN*, int); bool has_mouse_sp(SCREEN*); int init_color_sp(SCREEN*, short, short, short, short); int init_pair_sp(SCREEN*, short, short, short); int intrflush_sp(SCREEN*, WINDOW*, bool); bool isendwin_sp(SCREEN*); bool is_term_resized_sp(SCREEN*, int, int); char* keybound_sp(SCREEN*, int, int); int key_defined_sp(SCREEN*, const char *); NCURSES_CONST char * keyname_sp(SCREEN*, int); int keyok_sp(SCREEN*, int, bool); char killchar_sp(SCREEN*); int mcprint_sp(SCREEN*, char *, int); int mouseinterval_sp(SCREEN*, int); mmask_t mousemask_sp(SCREEN*, mmask_t, mmask_t *); int mvcur_sp(SCREEN*, int, int, int, int); int napms_sp(SCREEN*, int); WINDOW* newpad_sp(SCREEN*, int, int); SCREEN* new_prescr(void); SCREEN* newterm_sp(SCREEN*, NCURSES_CONST char *, FILE *, FILE *); WINDOW* newwin_sp(SCREEN*, int, int, int, int); int nl_sp(SCREEN*); int nocbreak_sp(SCREEN*); int noecho_sp(SCREEN*); int nofilter_sp(SCREEN*); int nonl_sp(SCREEN*); void noqiflush_sp(SCREEN*); int noraw_sp(SCREEN*); int pair_content_sp(SCREEN*, short, short*, short*); void qiflush_sp(SCREEN*); int raw_sp(SCREEN*); int reset_prog_mode_sp(SCREEN*); int reset_shell_mode_sp(SCREEN*); int resetty_sp(SCREEN*); int resize_term_sp(SCREEN*, int, int); int resizeterm_sp(SCREEN*, int, int); int restartterm_sp(SCREEN*, NCURSES_CONST char*, int, int *); int ripoffline_sp(SCREEN*, int, int (*)(WINDOW*, int)); int savetty_sp(SCREEN*); int scr_init_sp(SCREEN*, const char *); int scr_restore_sp(SCREEN*, const char *); int scr_set_sp(SCREEN*, const char *); TERMINAL* set_curterm_sp(SCREEN*, TERMINAL*); int set_escdelay_sp(SCREEN*, int); int set_tabsize_sp(SCREEN*, int); int slk_attroff_sp(SCREEN*, const chtype); int slk_attron_sp(SCREEN*, const chtype); int slk_attr_set_sp(SCREEN*, const attr_t, short, void*); int slk_attrset_sp(SCREEN*, const chtype); int slk_attr_sp(SCREEN*); int slk_clear_sp(SCREEN*); int slk_color_sp(SCREEN*, short); int slk_init_sp(SCREEN*, int); int slk_label_sp(SCREEN*, int); int slk_noutrefresh_sp(SCREEN*); int slk_refresh_sp(SCREEN*); int slk_restore_sp(SCREEN*); int slk_set_sp(SCREEN*, int, const char *, int); int slk_touch_sp(SCREEN*); int start_color_sp(SCREEN*); attr_t term_attrs_sp(SCREEN*); chtype termattrs_sp(SCREEN*); char* termname_sp(SCREEN*); int typeahead_sp(SCREEN*, int); NCURSES_CONST char* unctrl_sp(SCREEN*, chtype); int ungetch_sp(SCREEN*, int); int ungetmouse_sp(SCREEN*,MEVENT *); int unget_wch_sp(SCREEN*, const wchar_t); int use_default_colors_sp(SCREEN*); void use_env_sp(SCREEN*, bool); int use_legacy_coding_sp(SCREEN*, int); int vid_attr_sp(SCREEN*, attr_t, short, void *); int vidattr_sp(SCREEN*, chtype); int vid_puts_sp(SCREEN*, attr_t, short, void *, NCURSES_SP_OUTC); int vidputs_sp(SCREEN*, chtype, NCURSES_SP_OUTC); wchar_t* wunctrl_sp(SCREEN*, cchar_t *); #include <form.h> int new_form_sp(SCREEN*, FIELD **); #include <menu.h> int new_menu_sp(SCREEN*, ITEM **); #include <panel.h> int ceiling_panel(SCREEN*); PANEL* ground_panel(SCREEN*); int update_panels_sp(SCREEN*); #include <term.h> int del_curterm_sp(SCREEN*, TERMINAL *); int putp_sp(SCREEN*, const char *); int tgetflag_sp(SCREEN*, char *, const char *); int tgetent_sp(SCREEN*, char *, const char *); int tgetnum_sp(SCREEN*, NCURSES_CONST char *); char* tgetstr_sp(SCREEN*, NCURSES_CONST char *, char **); int tigetflag_sp(SCREEN*, NCURSES_CONST char *); int tigetnum_sp(SCREEN*, NCURSES_CONST char *); char* tigetstr_sp(SCREEN*, NCURSES_CONST char *); int tputs_sp(SCREEN*, const char *, int, NCURSES_SP_OUTC); DESCRIPTION
This implementation can be configured to provide a set of functions which improve the ability to manage multiple screens. This feature can be added to any of the configurations supported by ncurses; it adds new entrypoints without changing the meaning of any of the existing ones. IMPROVED FUNCTIONS Most of the functions are new versions of existing functions. A parameter is added at the front of the parameter list. It is a SCREEN pointer. The existing functions all use the current screen, which is a static variable. The extended functions use the specified screen, thereby reducing the number of variables which must be modified to update multiple screens. NEW FUNCTIONS Here are the new functions: ceiling_panel this returns a pointer to the topmost panel in the given screen. ground_panel this returns a pointer to the lowest panel in the given screen. new_prescr when creating a new screen, the library uses static variables which have been preset, e.g., by use_env(3X), filter(3X), etc. With the screen-pointer extension, there are situations where it must create a current screen before the unextended library does. The new_pre- scr function is used internally to handle these cases. It is also provided as an entrypoint to allow applications to customize the library initialization. NOTES
This extension introduces some new names: NCURSES_SP_FUNCS This is set to the library patch-level number. In the unextended library, this is zero(0), to make it useful for checking if the ex- tension is provided. NCURSES_SP_NAME The new functions are named using the macro NCURSES_SP_NAME, which hides the actual implementation. Currently this adds a "_sp" suf- fix to the name of the unextended function. This manual page indexes the extensions showing the full name. However the proper usage of these functions uses the macro, to provide for the possibility of changing the naming convention for specific library configura- tions. NCURSES_SP_OUTC This is a new function-pointer type to use in the screen-pointer functions where an NCURSES_OUTC is used in the unextended library. NCURSES_OUTC This is a function-pointer type used for the cases where a function passes characters to the output stream, e.g., vidputs(3X). PORTABILITY
These routines are specific to ncurses. They were not supported on Version 7, BSD or System V implementations. It is recommended that any code depending on ncurses extensions be conditioned using NCURSES_SP_FUNCS. SEE ALSO
curses(3X), curs_opaque(3X), curs_threads(3X). curs_sp_funcs(3X)
All times are GMT -4. The time now is 03:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy