Sponsored Content
Full Discussion: AWK - Line length validation
Top Forums Shell Programming and Scripting AWK - Line length validation Post 302116949 by en7smb on Wednesday 9th of May 2007 11:04:29 AM
Old 05-09-2007
Like it.

Thanks a lot.

Steve
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

awk data validation

Hi , This is a general doubt.... Is there any way to do data validation inside an awk script.. Let me make it more clear.... I have a string variable inside awk script .. Is there any way to check whether it is number or string etc... Thanks in advance. Shihab (1 Reply)
Discussion started by: shihabvk
1 Replies

2. Shell Programming and Scripting

Command line inputs validation

Hi, I have a script called read.sh that takes a file as input. Now I want to make that script take the file as input with a -f option preceding the filename. How can I do this validation. How can I find whether the given option is -f or not inside the script. Thanks in advance (2 Replies)
Discussion started by: sendhilmani123
2 Replies

3. Shell Programming and Scripting

Deleting Characters at specific position in a line if the line is certain length

I've got a file that would have lines similar to: 12345678 x.00 xx.00 x.00 xxx.00 xx.00 xx.00 xx.00 23456781 x.00 xx.00 xx.00 xx.00 xx.00 x.00 xxx.00 xx.00 xx.00 xx.00 34567812 x.00 xx.00 x.00 xxx.00 xx.00 xx.00 xx.00 45678123 x.00 xx.00 xx.00 xx.00 xx.00 x.00 xxx.00 xx.00 xx.00 xx.00 xx.00... (10 Replies)
Discussion started by: Cailet
10 Replies

4. Shell Programming and Scripting

awk date and time validation

How can i validate if user inserted date and optionly a time is vaild but in awk scripting? (18 Replies)
Discussion started by: tal
18 Replies

5. Shell Programming and Scripting

AWK - Line length validation

Hi, I have requirement where record length is stored in an variable RECORD_LENGTH Code goes as follows RECORD_LENGTH=537 the above is arrived from #RECORD_LENGTH=`awk -F"=" '{$sum+=$2} END{print $sum}' DBP_Claims_CFG.ini` awk ' { if (length() == '$RECORD_LENGTH') print FNR, $0... (4 Replies)
Discussion started by: ainuddin
4 Replies

6. Shell Programming and Scripting

Command line user input validation

Hi guys, I have a piece of snippet below which asks the user to input some numbers if isDatasubEnabled && isReconEnabled; then echo "1 = CGT, 2 = Subscriber, 3 = Order Monitor, 4 = Revaluations, 5 = Reconciliation, 6 = All, 7 = Exit" elif isDatasubEnabled &&... (4 Replies)
Discussion started by: pyscho
4 Replies

7. Shell Programming and Scripting

Check for length which exceeds specified length in a line

Hi, I have a issue, I need to loop through a comma delimited file and check for the length which exceeds specified length , if Yes truncate the string. But my problem is , I do not have to check for all the fields and the field lenght is not same for all the fields. For ex: Say my line... (9 Replies)
Discussion started by: rashmisb
9 Replies

8. Shell Programming and Scripting

Datatype and length validation

I have sourcefile and structure of source file,i want to check whether datatype and length mention in emp.txt is same as source file. Example: in emp.txt first row contains sno number so in source file also first column should contain only number if data is other than number then that... (1 Reply)
Discussion started by: katakamvivek
1 Replies

9. Shell Programming and Scripting

Length validation

I am using below code to find the length of first column additionally I want the complete row which length is greater than 12.at the end I want the rows where first column data length is greater than 12. Just it should validate and highlight the rows where length(first column) is greater than... (5 Replies)
Discussion started by: srivalli
5 Replies

10. UNIX for Dummies Questions & Answers

Help with awk, where line length and field position are variable

I have several questions about using awk. I'm hoping someone could lend me a hand. (I'm also hoping that my questions make sense.) I have a file that contains pipe separated data. Each line has similar data but the number of fields and the field position on each line is variable. ... (3 Replies)
Discussion started by: Cheese64
3 Replies
entryfield(1)							  [incr Widgets]						     entryfield(1)

__________________________________________________________________________________________________________________________________________________

NAME
entryfield - Create and manipulate a entry field widget SYNOPSIS
entryfield pathName ?options? INHERITANCE
itk::Widget <- LabeledWidget <- entryfield STANDARD OPTIONS
background borderWidth cursor exportSelection foreground highlightColor highlightThicknessinsertBackground insertBorderWidth insertOffTime insertOnTimeinsertWidth justify relief selectBackgroundselectBorderWidth selectForeground textVariable width See the "options" manual entry for details on the standard options. ASSOCIATED OPTIONS
show state See the "entry" manual entry for details on the 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: childSitePos Class: Position Command-Line Switch: -childsitepos Specifies the position of the child site in the entry field: n, s, e, or w. The default is e. Name: command Class: Command Command-Line Switch: -command Specifies a Tcl command to be executed upon detection of a Return key press event. Name: fixed Class: Fixed Command-Line Switch: -fixed Restrict entry to the specified number of chars. A value of 0, which is the default, denotes no limit. The value is the maximum number of chars the user may type into the field, regardles of field width. For example, if the field width is set to 20 and the fixed value is 10, the user will only be able to type 10 characters into the field which is 20 characters long. Name: focusCommand Class: Command Command-Line Switch: -focuscommand Specifies a Tcl command to be executed upon reception of focus. Name: invalid Class: Command Command-Line Switch: -invalid Specifies a Tcl command to be executed upon determination of invalid input. The default is bell. Name: textBackground Class: Background Command-Line Switch: -textbackground Background color for inside textual portion of the entry field. The value may be given in any of the forms acceptable to Tk_Get- Color. Name: textFont Class: Font Command-Line Switch: -textfont Name of font to use for display of text in entryfield. The value may be given in any of the forms acceptable to Tk_GetFont. Name: pasting Class: Behavior Command-Line Switch: -pasting Option to enable/disable pasting into the entry component of the entryfield. Valid values are 0 (disabled) or 1 (enabled). Defaults to 1. Name: validate Class: Command Command-Line Switch: -validate The validate option allows specification of a validation mechanism. Standard character validation such as numeric, alphabetic, integer, hexidecimal, real, and alphanumeric can be handled through the use of keywords. Should more extensive validation be neces- sary, the value may contain the name of a command script. The script should return a boolean value. True for valid, false for invalid. If false is returned, then the procedure associated with the invalid option will be invoked. If the validation script contains any % characters, then the script will not be executed directly. Instead, a new script will be generated by replacing each %, and the character following it, with information from the entryfield. The replacement depends on the character following the %, as defined in the list below. %c Replaced with the current input character. %P Replaced with the contents of the entryfield modified to include the latest keystoke. This is equivalent to peeking at the future contents, enabling rejection prior to the update. %S Replaced with the current contents of the entryfield prior to the latest keystroke being added. %W Replaced with the entryfield widget pathname. __________________________________________________________________________________________________________________________________________________ DESCRIPTION
The entryfield command creates an enhanced text entry widget with an optional associated label. Addtional options support validation and establishing a upper limit on the number of characters which may be entered in the field. METHODS
The entryfield command creates a new Tcl command whose name is pathName. This command may be used to invoke various operations on the wid- get. 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 entryfield widgets: ASSOCIATED METHODS
delete get icursor index insert scan selection xview See the "entry" 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 entryfield command. pathName childsite Returns the path name of the child site. pathName clear Clear entry widget 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 entryfield command. COMPONENTS
Name: efchildsite Class: frame The efchildsite component is the user child site for the entry field. See the "frame" widget manual entry for details on the efchildsite component item. Name: entry Class: entry The entry component provides the entry field for user text input and display. See the "entry" widget manual entry for details on the entry component item. EXAMPLE
option add *textBackground white proc returnCmd {} { puts stdout "Return Pressed" } proc invalidCmd {} { puts stdout "Alphabetic contents invalid" } entryfield .ef -command returnCmd entryfield .fef -labeltext "Fixed:" -fixed 10 -width 12 entryfield .nef -labeltext "Numeric:" -validate numeric -width 12 entryfield .aef -labeltext "Alphabetic:" -validate alphabetic -width 12 -invalid invalidCmd entryfield .pef -labeltext "Password:" -show 267 -width 12 -command returnCmd Labeledwidget::alignlabels .ef .fef .nef .aef .pef pack .ef -fill x -expand yes -padx 10 -pady 5 pack .fef -fill x -expand yes -padx 10 -pady 5 pack .nef -fill x -expand yes -padx 10 -pady 5 pack .aef -fill x -expand yes -padx 10 -pady 5 pack .pef -fill x -expand yes -padx 10 -pady 5 AUTHOR
Sue Yockey Mark L. Ulferts KEYWORDS
entryfield, widget Tk entryfield(1)
All times are GMT -4. The time now is 11:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy