I have a text file which I would like to sort, summarise and count between the pattern "--Current Database"
This is my text file:
And I would like the output to be like that
I know that cat file.txt | sort | uniq -c would sort, summarise and count all lines but I don't know how to do it between patterns. I also tried with "split" command but I wasn't able to make what I was expecting
Could somebody help me?
Thanks
Last edited by mac-arrow; 11-21-2018 at 07:08 AM..
Hi Gurus,
I have a file say for ex. file1 which has 3500 lines in it which are different account numbers and another file (file2) which has 230000 lines in it. I want to read all the lines in file1 and delete all those lines from file2 which has that same pattern as in file1. I am not quite... (4 Replies)
Hi to all.
I'm trying to sort this with the Unix command sort.
user1:12345678:3.5:2.5:8:1:2:3
user2:12345679:4.5:3.5:8:1:3:2
user3:12345687:5.5:2.5:6:1:3:2
user4:12345670:5.5:2.5:5:3:2:1
user5:12345671:2.5:5.5:7:2:3:1
I need to get this:
user3:12345687:5.5:2.5:6:1:3:2... (7 Replies)
Hello all -
I am to this forum and fairly new in learning unix and finding some difficulty in preparing a small shell script. I am trying to make script to sort all the files given by user as input (either the exact full name of the file or say the files matching the criteria like all files... (3 Replies)
Hello,
I have a large number of sed commands that I execute one after the other, simply because I don't know if there's a shorter way to do it. I hope someone can help me save some time :-)
These are my commands:
1.) remove all " in the file:
sed -e 's/\"//g' file
2.) insert ( and... (3 Replies)
sort --random-sort
The full command is
path=`find /testdir -maxdepth 1 -mindepth 1 -type d | ***Some sort of sort function*** | head -1`
I have a list I want to randomly sort. It works fine in ubuntu but on a 'osx lion' sort dosen't have the --random-sort option.
I don't want to... (5 Replies)
Input file:
100%ABC2 3.44E-12 USA
A2M%H02579 0E0 UK
100%ABC2 5.34E-8 UK
100%ABC2 3.25E-12 USA
A2M%H02579 5E-45 UK
Output file:
100%ABC2 3.44E-12 USA
100%ABC2 3.25E-12 USA
100%ABC2 5.34E-8 UK
A2M%H02579 0E0 UK
A2M%H02579 5E-45 UK
Code try:
sort -k1,1 -g -k2 -r input.txt... (2 Replies)
Hi Experts,
I have a filelist collected from another server , now want to sort the output using date/time stamp filed.
- Filed 6, 7,8 are showing the date/time/stamp.
Here is the input:
#----------------------------------------------------------------------
-rw------- 1 root ... (3 Replies)
Hi,
I am trying to extract some patterns from a line. The input file is space delimited and i could not use column to get value after "IN" or "OUT" patterns as there could be multiple white spaces before the next digits that i need to print in the output file . I need to print 3 patterns in a... (3 Replies)
Hello.
For a given folder, I want to select any files find $PATH1 -f \( -name "*" but omit any files like pattern name ! -iname "*.jpg" ! -iname "*.xsession*" ..... \) and also omit any subfolder like pattern name -type d \( -name "/etc/gconf/gconf.*" -o -name "*cache*" -o -name "*Cache*" -o... (2 Replies)
How to sort the following output based on lowest to highest BE?
The following sort does not work.
$ sort -t. -k1,1n -k2,2n bfd.txt
BE31.116 0s 0s DOWN DAMP
BE31.116 0s 0s DOWN DAMP
BE31.117 0s 0s ... (7 Replies)
Discussion started by: sand1234
7 Replies
LEARN ABOUT DEBIAN
ttk::checkbutton
ttk::checkbutton(3tk) Tk Themed Widget ttk::checkbutton(3tk)__________________________________________________________________________________________________________________________________________________NAME
ttk::checkbutton - On/off widget
SYNOPSIS
ttk::checkbutton pathName ?options?
_________________________________________________________________DESCRIPTION
A ttk::checkbutton widget is used to show or change a setting. It has two states, selected and deselected. The state of the checkbutton
may be linked to a Tcl variable.
STANDARD OPTIONS -class-compound-cursor
-image-state-style
-takefocus-text-textvariable
-underline-width
See the ttk_widget manual entry for details on the standard options.
WIDGET-SPECIFIC OPTIONS
Command-Line Name:-command
Database Name: command
Database Class: Command
A Tcl script to execute whenever the widget is invoked.
Command-Line Name:-offvalue
Database Name: offValue
Database Class: OffValue
The value to store in the associated -variable when the widget is deselected. Defaults to 0.
Command-Line Name:-onvalue
Database Name: onValue
Database Class: OnValue
The value to store in the associated -variable when the widget is selected. Defaults to 1.
Command-Line Name:-variable
Database Name: variable
Database Class: Variable
The name of a global variable whose value is linked to the widget. Defaults to the widget pathname if not specified.
WIDGET COMMAND
In addition to the standard cget, configure, identify, instate, and state commands, checkbuttons support the following additional widget
commands:
pathname invoke
Toggles between the selected and deselected states and evaluates the associated -command. If the widget is currently selected, sets
the -variable to the -offvalue and deselects the widget; otherwise, sets the -variable to the -onvalue Returns the result of the
-command.
WIDGET STATES
The widget does not respond to user input if the disabled state is set. The widget sets the selected state whenever the linked -variable
is set to the widget's -onvalue, and clears it otherwise. The widget sets the alternate state whenever the linked -variable is unset.
(The alternate state may be used to indicate a "tri-state" or "indeterminate" selection.)
STANDARD STYLES
Ttk::checkbutton widgets support the Toolbutton style in all standard themes, which is useful for creating widgets for toolbars.
SEE ALSO ttk::widget(3tk), ttk::radiobutton(3tk), checkbutton(3tk)KEYWORDS
widget, button, toggle, check, option
Tk 8.5 ttk::checkbutton(3tk)