Sponsored Content
Top Forums Shell Programming and Scripting substitution of varying digits Post 302388245 by rdcwayx on Wednesday 20th of January 2010 12:08:58 AM
Old 01-20-2010
Code:
$ echo "1234567890000000000012345"  |awk -F "" '{for (i=7;i<=(NF-4);i++) $i="*"}1' OFS=""
123456***************2345



---------- Post updated at 12:08 AM ---------- Previous update was at 12:01 AM ----------

provide sample of your txt file here, we give you one line solution.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Varying number of awk search strings

I've created an awk script that handles a varying number of search strings handed to it as command line parameters ($1 $2 etc). There may be 1, or 2 or 3 or more. A simplified version of the script is: awk -v TYP="$1 $2 $3 $4 $5 $6" ' BEGIN { CTYP = split (TYP,TYPP," ") } ... (2 Replies)
Discussion started by: CarlosNC
2 Replies

2. Shell Programming and Scripting

extract string from varying delimiter line

Hi I have lines like this a=1, b=2, c=3, a=1, d=4, e=5, b=225, I need to extract the b=nnn... value. I dont know how many other entries will be before and after it in each line. Ive tried a basic line like awk '/b=/, $NF ~ /,/ ' myfile.txt but I think that it doesnt care which comma it... (5 Replies)
Discussion started by: rebelbuttmunch
5 Replies

3. Shell Programming and Scripting

help: single digits inflated to 2 digits

Hi Folks Probably an easy one here but how do I get a sequence to get used as mentioned. For example in the following I want to automatically create files that have a 2 digit number at the end of their names: m@pyhead:~$ for x in $(seq 00 10); do touch file_$x; done m@pyhead:~$ ls file*... (2 Replies)
Discussion started by: amadain
2 Replies

4. Shell Programming and Scripting

How to check the varying file size

How to know a file is of fixed file or not over a span of time Actually my requirement is to check the size of the file in a specific directory for 60 seconds, and if it remains the same then I have to move to some other directory.Else I have to stop the execution. Request you to guide me in... (4 Replies)
Discussion started by: av_vinay
4 Replies

5. Shell Programming and Scripting

Insert varying length spaces between words

Hey all, Fist post, so be kind... I have written an expect script which logs into a terminal and gathers several screens of information. Unfortunately the log file gives me all the special escape and control characters from the terminal. I am hoping to use a combination of shell scripting, sed,... (1 Reply)
Discussion started by: mpacer
1 Replies

6. Shell Programming and Scripting

Find filenames with three digits and add zeros to make five digits

Hello all! I've looked all over the internet and this site and have come up a loss with an easy way to make a bash script to do what I want to do. I have a file with a naming convention as follows: 2012-01-18 string of words here 123.jpg 2012-01-18 string of words here 1234.jpg 2012-01-18... (2 Replies)
Discussion started by: Buzzman25
2 Replies

7. UNIX for Dummies Questions & Answers

Help with varying data

I have flat file in which the length of the a record is 1000 characters. the last field of the file range is from 951 to 1000. So currently i am getting the last field data to be less than 1000 characters ( from 951 to 1000 i see that the data varies from 10 to 50). So is there a way we can pad up... (18 Replies)
Discussion started by: akshay01987
18 Replies

8. Shell Programming and Scripting

Paste files of varying lengths

I have three files of varying lengths and different number of columns. How can I paste all three with all columns aligned? File1 ---- 123 File2 ---- 234 345 678 File3 ---- 456 789 Output should look like: 123 234 456 345 789 (6 Replies)
Discussion started by: Un1xNewb1e
6 Replies

9. Shell Programming and Scripting

Merge lines with varying characters

Hi, I have a large set of data (firewall logs) that I'm trying to summarize. I've been able to write a script to consolidate the ports, now am looking to conslidate even further, based on IP. Source Destination Type Port 192.168.5.108 192.168.11.12 TCP 1, 2, 3, 4, 5, 15 192.168.5.109... (6 Replies)
Discussion started by: umang2382
6 Replies

10. UNIX for Beginners Questions & Answers

sed / awk script to delete the two digits from first 3 digits

Hi All , I am having an input file as stated below 5728 U_TOP_LOGIC/U_CM0P/core/u_cortexm0plus/u_top/u_sys/u_core/r03_q_reg_20_/Q 011 611 U_TOP_LOGIC/U_CM0P/core/u_cortexm0plus/u_top/u_sys/u_core/r04_q_reg_20_/Q 011 3486... (4 Replies)
Discussion started by: kshitij
4 Replies
panel(3X)																 panel(3X)

NAME
panel - panel stack extension for curses SYNOPSIS
#include <panel.h> cc [flags] sourcefiles -lpanel -lncurses PANEL *new_panel(WINDOW *win) int bottom_panel(PANEL *pan) int top_panel(PANEL *pan) int show_panel(PANEL *pan) void update_panels(); int hide_panel(PANEL *pan) WINDOW *panel_window(const PANEL *pan) int replace_panel(PANEL *pan, WINDOW *window) int move_panel(PANEL *pan, int starty, int startx) int panel_hidden(const PANEL *pan) PANEL *panel_above(const PANEL *pan) PANEL *panel_below(const PANEL *pan) int set_panel_userptr(PANEL *pan, const void *ptr) const void *panel_userptr(const PANEL *pan) int del_panel(PANEL *pan) DESCRIPTION
Panels are curses(3X) windows with the added feature of depth. Panel functions allow the use of stacked windows and ensure the proper por- tions of each window and the curses stdscr window are hidden or displayed when panels are added, moved, modified or removed. The set of currently visible panels is the stack of panels. The stdscr window is beneath all panels, and is not considered part of the stack. A window is associated with every panel. The panel routines enable you to create, move, hides, and show panels, as well as position a panel at any desired location in the stack. Panel routines are a functional layer added to curses(3X), make only high-level curses calls, and work anywhere terminfo curses does. FUNCTIONS
new_panel(win) allocates a PANEL structure, associates it with win, places the panel on the top of the stack (causes it to be displayed above any other panel) and returns a pointer to the new panel. void update_panels() refreshes the virtual screen to reflect the relations between the panels in the stack, but does not call doupdate() to refresh the physical screen. Use this function and not wrefresh or wnoutrefresh. update_panels() may be called more than once before a call to doupdate(), but doupdate() is the function responsible for updating the physical screen. del_panel(pan) removes the given panel from the stack and deallocates the PANEL structure (but not its associated window). hide_panel(pan) removes the given panel from the panel stack and thus hides it from view. The PANEL structure is not lost, merely removed from the stack. show_panel(pan) makes a hidden panel visible by placing it on top of the panels in the panel stack. See COMPATIBILITY below. top_panel(pan) puts the given visible panel on top of all panels in the stack. See COMPATIBILITY below. bottom_panel(pan) puts panel at the bottom of all panels. move_panel(pan,starty,startx) moves the given panel window so that its upper-left corner is at starty, startx. It does not change the position of the panel in the stack. Be sure to use this function, not mvwin(), to move a panel window. replace_panel(pan,window) replaces the current window of panel with window (useful, for example if you want to resize a panel; if you're using ncurses, you can call replace_panel on the output of wresize(3X)). It does not change the position of the panel in the stack. panel_above(pan) returns a pointer to the panel above pan. If the panel argument is (PANEL *)0, it returns a pointer to the bottom panel in the stack. panel_below(pan) returns a pointer to the panel just below pan. If the panel argument is (PANEL *)0, it returns a pointer to the top panel in the stack. set_panel_userptr(pan,ptr) sets the panel's user pointer. panel_userptr(pan) returns the user pointer for a given panel. panel_window(pan) returns a pointer to the window of the given panel. DIAGNOSTICS
Each routine that returns a pointer returns NULL if an error occurs. Each routine that returns an int value returns OK if it executes suc- cessfully and ERR if not. COMPATIBILITY
Reasonable care has been taken to ensure compatibility with the native panel facility introduced in SVr3.2 (inspection of the SVr4 manual pages suggests the programming interface is unchanged). The PANEL data structures are merely similar. The programmer is cautioned not to directly use PANEL fields. The functions show_panel() and top_panel() are identical in this implementation, and work equally well with displayed or hidden panels. In the native System V implementation, show_panel() is intended for making a hidden panel visible (at the top of the stack) and top_panel() is intended for making an already-visible panel move to the top of the stack. You are cautioned to use the correct function to ensure compati- bility with native panel libraries. NOTE
In your library list, libpanel.a should be before libncurses.a; that is, you want to say `-lpanel -lncurses', not the other way around (which would give you a link error using GNU ld(1) and some other linkers). FILES
panel.h interface for the panels library libpanel.a the panels library itself SEE ALSO
curses(3X) AUTHOR
Originally written by Warren Tucker <wht@n4hgf.mt-park.ga.us>, primarily to assist in porting u386mon to systems without a native panels library. Repackaged for ncurses by Zeyd ben-Halim. panel(3X)
All times are GMT -4. The time now is 10:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy