Hi,
I just wandering how to split a record which has more than one delimiter,
i have a file which contains pattern as group separtor and ~ as field separtor, Ultimately I need consider even the groups as a field, So i need to make this multi-delimited file into ~ delimited file.
My record... (4 Replies)
hi, pls someone tell me how to extract delimiters from any file and pass it to a unix script.since, im a beginner in unix i find it little bit difficult.how to use awk to do this? (9 Replies)
Hi
I have a file in which delimiter is ';'
However if the delimiter is within "" it is a part of the string and not delimiter.
How to get the fields ? I want to replace the delimiter ';' to '|'.
The file contains data like this :
11111; “2222 2222”; “3333; 3333”; “4444 ""44444”
The file... (2 Replies)
Hello,
I am trying to find the record count in a specific folder,
Here is the part of the code
===========================
STARTDATE=`date +"%y%m%d%H%M"`
for i in `ls *.DAT`
do
wc -l $i >> /XYZ/SrcFiles/"Record_counts"$STARTDATE.csv
... (2 Replies)
Hi All,
I woul like to know with out opening a file in unix ,how we can find out what is the delemeter in that file...
Thanks..
edit by bakunin: changed thread title to "delimiter" so it can be found. (4 Replies)
Hi there,
I am with this one column input text file to change layout, please help. Thanks. I have awk, sed.
$ cat input
Median
1.0
2.3
3.0
Median
35.0
26.3
45.7
10.1
63.1
Median
1.2
2.3 (8 Replies)
Hi,
I have a No Delimiter variable length text file with following schema -
Column Name Data length
Firstname 5
Lastname 5
age 3
phoneno1 10
phoneno2 10
phoneno3 10
sample data - ... (16 Replies)
Hi,
I have a input
/dev/cm/test1.txt
/qa/tm/hmkr/cc/test2.txt
and I need an out like below
foldername, filename
/dev/cm/,test1.txt
/qa/tm/hmkr/cc/,test2.txt
I tried with awk $NF, but I'm getting the filenames and not folder names. Please let me know how to achive the above... (5 Replies)
Hi,
Extremely new to Perl scripting, but need a quick fix without using TEXT::CSV
I need to read in a file, pass any delimiter as an argument, and convert it to bar delimited on the output. In addition, enclose fields within double quotes in case of any embedded delimiters.
Any help would... (2 Replies)
Discussion started by: JPB1977
2 Replies
LEARN ABOUT SUSE
rrds
RRDs(3) User Contributed Perl Documentation RRDs(3)NAME
RRDs - Access RRDtool as a shared module
SYNOPSIS
use RRDs;
RRDs::error
RRDs::last ...
RRDs::info ...
RRDs::create ...
RRDs::update ...
RRDs::updatev ...
RRDs::graph ...
RRDs::fetch ...
RRDs::tune ...
RRDs::times(start, end)
RRDs::dump ...
RRDs::restore ...
RRDs::flushcached ...
DESCRIPTION
Calling Sequence
This module accesses RRDtool functionality directly from within Perl. The arguments to the functions listed in the SYNOPSIS are explained
in the regular RRDtool documentation. The command line call
rrdtool update mydemo.rrd --template in:out N:12:13
gets turned into
RRDs::update ("mydemo.rrd", "--template", "in:out", "N:12:13");
Note that
--template=in:out
is also valid.
The RRDs::times function takes two parameters: a "start" and "end" time. These should be specified in the AT-STYLE TIME SPECIFICATION
format used by RRDtool. See the rrdfetch documentation for a detailed explanation on how to specify time.
Error Handling
The RRD functions will not abort your program even when they can not make sense out of the arguments you fed them.
The function RRDs::error should be called to get the error status after each function call. If RRDs::error does not return anything then
the previous function has completed its task successfully.
use RRDs;
RRDs::update ("mydemo.rrd","N:12:13");
my $ERR=RRDs::error;
die "ERROR while updating mydemo.rrd: $ERR
" if $ERR;
Return Values
The functions RRDs::last, RRDs::graph, RRDs::info, RRDs::fetch and RRDs::times return their findings.
RRDs::last returns a single INTEGER representing the last update time.
$lastupdate = RRDs::last ...
RRDs::graph returns an ARRAY containing the x-size and y-size of the created image and a pointer to an array with the results of the PRINT
arguments.
($result_arr,$xsize,$ysize) = RRDs::graph ...
print "Imagesize: ${xsize}x${ysize}
";
print "Averages: ", (join ", ", @$averages);
RRDs::info returns a pointer to a hash. The keys of the hash represent the property names of the RRD and the values of the hash are the
values of the properties.
$hash = RRDs::info "example.rrd";
foreach my $key (keys %$hash){
print "$key = $$hash{$key}
";
}
RRDs::graphv takes the same parameters as RRDs::graph but it returns a pointer to hash. The hash returned contains meta information about
the graph. Like its size as well as the position of the graph area on the image. When calling with and empty filename than the contents of
the graph will be returned in the hash as well (key 'image').
RRDs::updatev also returns a pointer to hash. The keys of the hash are concatenated strings of a timestamp, RRA index, and data source name
for each consolidated data point (CDP) written to disk as a result of the current update call. The hash values are CDP values.
RRDs::fetch is the most complex of the pack regarding return values. There are 4 values. Two normal integers, a pointer to an array and a
pointer to a array of pointers.
my ($start,$step,$names,$data) = RRDs::fetch ...
print "Start: ", scalar localtime($start), " ($start)
";
print "Step size: $step seconds
";
print "DS names: ", join (", ", @$names)."
";
print "Data points: ", $#$data + 1, "
";
print "Data:
";
for my $line (@$data) {
print " ", scalar localtime($start), " ($start) ";
$start += $step;
for my $val (@$line) {
printf "%12.1f ", $val;
}
print "
";
}
RRDs::times returns two integers which are the number of seconds since epoch (1970-01-01) for the supplied "start" and "end" arguments,
respectively.
See the examples directory for more ways to use this extension.
NOTE
If you are manipulating the TZ variable you should also call the POSIX function tzset(3) to initialize all internal state of the library
for properly operating in the timezone of your choice.
use POSIX qw(tzset);
$ENV{TZ} = 'CET';
POSIX::tzset();
AUTHOR
Tobias Oetiker <tobi@oetiker.ch>
perl v5.12.1 2010-03-22 RRDs(3)