Hi,
If there exist multiple pattern in a file, how can I find the last record matching the pattern through perl.
The below script searches for the pattern everywhere in an input file.
#! /usr/bin/perl -s -wnl
BEGIN {
$pattern or
warn"Usage: $0 -pattern='RE' \n" and
exit 255;... (5 Replies)
Dear All
I have a file like this
112534554
446538656
444695656
225696966
226569744
228787874
113536566
443533535
222564552
115464656
225445345
225533234
I want to cut the file into different parts where the first two columns are '11' . The first two columns will be either... (3 Replies)
Hi
I have a file (say 'file1')and I want to search for a first occurence of pattern (say 'ERROR') and print ten lines in the file below pattern. I have to code it in PERL and I am using Solaris 5.9.
I appreciate any help with code
Thanks
Ammu (6 Replies)
Hi,
I am new to ksh scripting and I have a problem.
I have a file in which I have to search for a particular pattern say 'a' then from that line I need to search for another pattern say 'b' in the previous lines and thne print the file from pattern 'b' till the end of file.
For eg:
... (2 Replies)
i have a file as below
sample.pl
parameter1
argument1
argument2
parameter2
I want out as below
argument1
argument2
that is , i want to print all the lines between parameter1 & parameter 2.
i tried with the following
if($mystring =~ m/parameter1(.*?)parameter2/) (2 Replies)
Hello,
I'm new to this forum. I've been doing a lot of sed work lately and have found many useful tips on this forum. I've hit a roadblock in a project, though, and could really use some help.
I have a text file with many lines like the following, i.e., some lines begin with a single word... (3 Replies)
Hi all,
on Solaris 10, I'd like to print a range of lines starting at pattern but also including the very first line before pattern.
the following doesn't print the range starting at pattern and going down to the end of file: cat <my file> | sed -n -e '/<pattern>{x;p;}/'
I need to include the... (1 Reply)
Hi,
I have script like below:
#!/usr/local/bin/perl
use strict;
use warnings;
while (<DATA>) {
( my ($s_id) = /^\d+\|(\d+?)\|/ ) ;
if ( $s_id == 1 ){
s/^(.*\|)*.*ABC\.pi=(+|+)*.*ABC\.id=(\d+|+).*$/$1$2|$3/s;
print "$1$2|$3\n"; (2 Replies)
hello everyone,
im new here, and also programming with awk, sed and grep commands on linux.
In my text i have many lines with this config:
1 1 4 3 1 1 2 5
2 2 1 1 1 3 1 2
1 3 1 1 1 2 2 2
5 2 4 1
3 2 1 1 4 1 2 1
1 1 3 2 1 1 5 4
1 3 1 1... (3 Replies)
Hello,
I have below format log file,
Comparing csv_converted_files/2201/9747.1012H67126.5077292103609547345.csv and csv_converted_files/22019/97447.1012H67126.5077292103609547345.csv
Comparing csv_converted_files/2559/9447.1012H67126.5077292103609547345.csv and... (6 Replies)
Discussion started by: arvindshukla81
6 Replies
LEARN ABOUT DEBIAN
kst2
kst(1) kst2 kst(1)NAME
kst -- plots scientific data
SYNOPSIS
kst
kst [ -F DATASOURCE ] [ -f STARTFRAME ] [ -n NUMFRAMES ] [ -s FRAMESPERSAMPLE [ -a ] ] kstfile
kst datasource [ -f STARTFRAME ] [ -n NUMFRAMES ] [ -s FRAMESPERSAMPLE [ -a ] ] [ -P PLOTNAME ] [ -A] [ -d ] [ -l ] [ -b ] [ -x FIELD ]
[ -e FIELD ] [ -r RATE ] [ -y FIELD ] [ -p FIELD ] [ -h FIELD ] [ -z FIELD ] [ --png filename ] [ --print filename [ --landscape |
--portrait ] [ --Letter | --A4 ] ]
DESCRIPTION
kst is a graphical data plotting tool, which includes the ability to plot live data (contiuously update the plot as new data becomes avail-
able).
kst may be run entirely from within its GUI, in which case no command line arguments are needed. kst has a powerful wizard for easily set-
ting up new plots.
In the second invocation, kst loads pre-saved plot specifications from the file kstfile and optionally may override some of the settings in
that file.
In the third invocation, kst displays plots of the data as directed in the default manner. Additional datasources may be specified on the
command line with options for that datasource following it. Command line options generally apply to all subsequent options unless later
overridden.
OPTIONS -A plot all curves in separate plots
-a average frames (simple mean) when plotting with -s.
--A4 use A4 sized paper for printing. Requires --print.
-b plot as bargraphs.
-d use points when plotting curves.
-e FIELD
use FIELD as the magnitude of error bars applied to the next plot.
-F datasource
override the datasource indicated in the kstfile and instead use datasource.
-f STARTFRAME
begin plotting at STARTFRAME frames into the data. Set to -1 to start at NUMFRAMES from the end of the data.
-h FIELD
plot FIELD as a histogram.
-l use lines when plotting curves.
--landscape
use landscape orientation for printing. Requires --print.--Letter use US Letter sized paper for printing. Requires --print.
-n NUMFRAMES
plot at most NUMFRAMES frames of data. Set to -1 to indicate all of the data.
-P PLOTNAME
plot all plots in the plot named PLOTNAME.
-p FIELD
plot FIELD as a power spectrum plot.
--png filename
render to a portable network graphics (png) image with file name filename and quit.
--portrait
use portrait orientation for printing. Requires --print.
--print filename
print the plot to file filename and quit.
-s FRAMESPERSAMPLE
plot every FRAMESPERSAMPLE frames when plotting.
-x FIELD
use FIELD as the X-axis vector.
-y FIELD
plot FIELD as an XY plot.
-z FIELD
plot FIELD as an image.
EXAMPLES
Plot all data in column 2 from data.dat.
kst data.dat -y 2
Same as above, except only read 20 lines, starting at line 10.
kst data.dat -f 10 -n 20 -y 2
also read col 1. One plot per curve.
kst data.dat -f 10 -n 20 -y 1 -y 2
Read col 1 from data2.dat and col 1 from data.dat
kst data.dat -f 10 -n 20 -y 2 data2.dat -y 1
Same as above, except read 40 lines starting at 30 in data2.dat
kst data.dat -f 10 -n 20 -y 2 data2.dat -f 30 -n 40 -y 1
Specify the X vector and error bars: Plot x = col 1 and Y = col 2 and error flags = col 3 from data.dat
kst data.dat -x 1 -e 3 -y 2
Get the X vector from data1.dat, and the Y vector from data2.dat.
kst data1.dat -x 1 data2.dat -y 1
Placement: Plot column 2 and column 3 in plot P1 and column 4 in plot P2
kst data.dat -P P1 -y 2 -y 3 -P P2 -y 4
BUGS
Please report bugs to either the kst mailing list at kst@kde.org or to the kde bugzilla under the kst product at http://bugs.kde.org/. If
you can run kst, you can easily report bugs by selecting Bug Report Wizard from the Help menu.
AUTHOR
Matthew Truch <matt@truch.net>
LICENSE
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts. A copy of the license is included in the `COPYING.DOC' file as part of the kst distribution.
Version 2.0.3 22 February 2011 kst(1)