Sponsored Content
Full Discussion: Writing a dummy line!!
Top Forums UNIX for Dummies Questions & Answers Writing a dummy line!! Post 302845353 by RavinderSingh13 on Wednesday 21st of August 2013 10:25:26 AM
Old 08-21-2013
Hello,

Could you please try the following also. Here lets say file name file_entry have all the fields as shown by you.

Code:
awk 'NR==3 {print"file_3 0 0"} 1' file_entry


Output will be as follows.

Code:
file_1 100 200
file_2 200 300
file_3 0 0
file_4 400 500
$


Thanks,
R. Singh
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Accepting filename as command line param and writing to it

Hi, Is it possible to accept a filename as command line parameter and then write to that file using command redirection? i tried the below script. outputfile=`echo $1` echo "Writing to file" > 'echo $outputfile' exit $returncode but it isnt working. is there any other way to... (9 Replies)
Discussion started by: silas.john
9 Replies

2. Shell Programming and Scripting

writing into one line

hi i have a file contains data Line timeout: START->SIGNON_REPLY, SIGNON_REPLY->SIGNON, Received SOT req SOT request: SIGNON->SOT_REPLY, SOT_REPLY->DATA_RECEIVE, DATA_RECEIVE->EOD, i need to write into one line , separated by commas please help thanks Satya (2 Replies)
Discussion started by: Satyak
2 Replies

3. Shell Programming and Scripting

Writing line to a file

Hi, I'm reading and writing a line from one file to another. Input line is like this: My name is David. Working on a shell script now. When I use "echo" or "print" output comes like this, My name is David. Working on a shell script now. Sample... (7 Replies)
Discussion started by: dateez
7 Replies

4. Shell Programming and Scripting

writing data in a text file at particular line

I need to write value of variable $version at a particular line in a text file. Line number is determined by another variable &line......I don't know how to do it in shell script ... (2 Replies)
Discussion started by: punitpa
2 Replies

5. Shell Programming and Scripting

writing shell script to find line of invalid characters

Hi, I have to write s script to check an input file for invalid characters. In this script I have to find the exact line of the invalid character. If the input file contain 2 invalid character sat line 10 and 17, the script will show the value 10 and 17. Any help is appreciated. (3 Replies)
Discussion started by: beginner82
3 Replies

6. Shell Programming and Scripting

writing string to specific line

I want to put a text string in file using any method on specific line line number 30 text to be put %this is location /var/www/filename (3 Replies)
Discussion started by: aliahsan81
3 Replies

7. Shell Programming and Scripting

Preserving newlines when writing loops on the command line in bash

Dear All, I have a question that's been difficult to get an answer to. I often write command line loops, e.g. find files, print name, grep for term, apply sed, etc I use both zsh and bash. When I write a loop e.g. for line in `more myfile.txt` > do > echo $line > done but... (2 Replies)
Discussion started by: JohnK1
2 Replies

8. Shell Programming and Scripting

writing in a file's particular column number of every line during runtime

Given a particular line number and a corresponding column number, can i write something in the file during run time? For example x=1 and during runtime i want to write the value of x in column 100 of every line of a given file, then how shud that be done? Thanks (9 Replies)
Discussion started by: arindamlive
9 Replies

9. Shell Programming and Scripting

How do i find the first number in each line and insert dummy string into the missing columns?

Hi, I have one input file with the following content: MY_inpfile.txt Aname1 Cname1 Cname2 1808 5 Aname2 Cname1 1802 47 Bname1 ? 1819 22 Bname2 Cname1 1784 11 Bname3 1817 9 Zname1 Cname1 1805 59 Zname2 Cname1 Cname2 Cname3 1797 27 Every line in my input file have a 4 digit... (5 Replies)
Discussion started by: Szaffy
5 Replies

10. Shell Programming and Scripting

Python DictWriter header - not writing in first line of existing file

Hello I am facing a very unique problem and not able to understand why. I have written a function which will check header of the file. If header is present good else it will write the header on top def writeHeaderOutputCSV(fileName): # See if the file exist already try: ... (0 Replies)
Discussion started by: radioactive9
0 Replies
scrolledcanvas(1)						  [incr Widgets]						 scrolledcanvas(1)

__________________________________________________________________________________________________________________________________________________

NAME
scrolledcanvas - Create and manipulate scrolled canvas widgets SYNOPSIS
scrolledcanvas pathName ?options? INHERITANCE
itk::Widget <- Labeledwidget <- Scrolledwidget <- Scrolledcanvas STANDARD OPTIONS
activeBackground background borderWidthcursor exportSelection font foreground highlightColor highlightThickness insertBorderWidthinsertOffTimeinsertOnTime insertWidth relief selectBackgroundselectBorderWidth selectForeground See the "options" manual entry for details on the standard options. ASSOCIATED OPTIONS
closeEnough confine scrollRegion xScrollIncrement yScrollIncrement See the "canvas" widget manual entry for details on the above associated options. activeRelief elementBorderWidth jumptroughColor See the "scrollbar" widget manual entry for details on the above associated options. INHERITED OPTIONS
disabledForeground labelBitmap labelFontlabelImage labelMargin labelPos labelText labelVariable state See the "labeledwidget" class manual entry for details on the inherited options. WIDGET-SPECIFIC OPTIONS Name: autoMargin Class: AutoMargin Command-Line Switch: -automargin Specifies the autoresize extra margin to reserve. This option is only effective with autoresize turned on. The default is 10. Name: autoResize Class: AutoResize Command-Line Switch: -autoresize Automatically adjusts the scrolled region to be the bounding box covering all the items in the canvas following the execution of any method which creates or destroys items. Thus, as new items are added, the scrollbars adjust accordingly. Name: height Class: Height Command-Line Switch: -height Specifies the height of the scrolled canvas widget in any of the forms acceptable to Tk_GetPixels. The default height is 30 pixels. Name: hscrollMode Class: ScrollMode Command-Line Switch: -hscrollmode Specifies the the display mode to be used for the horizontal scrollbar: static, dynamic, or none. In static mode, the scroll bar is displayed at all times. Dynamic mode displays the scroll bar as required, and none disables the scroll bar display. The default is static. Name: sbWidth Class: Width Command-Line Switch: -sbwidth Specifies the width of the scrollbar in any of the forms acceptable to Tk_GetPixels. The default width is 15 pixels.. Name: scrollMargin Class: ScrollMargin Command-Line Switch: -scrollmargin Specifies the distance between the canvas and scrollbar in any of the forms acceptable to Tk_GetPixels. The default is 3 pixels. Name: textBackground Class: Background Command-Line Switch -textbackground Specifies the background color for the canvas. This allows the background within the canvas to be different from the normal back- ground color. Name: vscrollMode Class: ScrollMode Command-Line Switch: -vscrollmode Specifies the the display mode to be used for the vertical scrollbar: static, dynamic, or none. In static mode, the scroll bar is displayed at all times. Dynamic mode displays the scroll bar as required, and none disables the scroll bar display. The default is static. Name: width Class: Width Command-Line Switch: -width Specifies the width of the scrolled canvas widget in any of the forms acceptable to Tk_GetPixels. The default height is 30 pixels. __________________________________________________________________________________________________________________________________________________ DESCRIPTION
The scrolledcanvas command creates a scrolled canvas with additional options to manage horizontal and vertical scrollbars. This includes options to control which scrollbars are displayed and the method, i.e. statically or dynamically. METHODS
The scrolledcanvas command creates a new Tcl command whose name is pathName. This command may be used to invoke various operations on the widget. It has the following general form: pathName option ?arg arg ...? Option and the args determine the exact behavior of the command. The following commands are possible for scrolledcanvas widgets: ASSOCIATED METHODS
addtag bbox bind canvasx canvasy coords create dchars delete dtag find focus gettags icursor index insert itemconfigure lower move postscript raise scale scan select type xview yview See the "canvas" manual entry for details on the associated methods. WIDGET-SPECIFIC METHODS pathName cget option Returns the current value of the configuration option given by option. Option may have any of the values accepted by the scrolled- canvas command. pathName childsite Returns the child site widget path name. pathName configure ?option? ?value option value ...? Query or modify the configuration options of the widget. If no option is specified, returns a list describing all of the available options for pathName (see Tk_ConfigureInfo for information on the format of this list). If option is specified with no value, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified). If one or more option-value pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. Option may have any of the values accepted by the scrolledcanvas command. pathName justify direction Justifies the canvas contents via the scroll bars in one of four directions: left, right, top, or bottom. COMPONENTS
Name: canvas Class: Canvas The canvas component is the canvas widget. See the "canvas" widget manual entry for details on the canvas component item. Name: horizsb Class: Scrollbar The horizsb component is the horizontal scroll bar. See the "ScrollBar" widget manual entry for details on the horizsb component item. Name: vertsb Class: Scrollbar The vertsb component is the vertical scroll bar. See the "ScrollBar" widget manual entry for details on the vertsb component item. EXAMPLE
scrolledcanvas .sc .sc create rectangle 100 100 400 400 -fill red .sc create rectangle 300 300 600 600 -fill green .sc create rectangle 200 200 500 500 -fill blue pack .sc -padx 10 -pady 10 -fill both -expand yes AUTHOR
Mark L. Ulferts KEYWORDS
scrolledcanvas, canvas, widget Tk scrolledcanvas(1)
All times are GMT -4. The time now is 08:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy