Hi guys, I hope you can help me with my problem.
I have a text file that contains lines like this:
78 ANGELO -809.05
79 ANGELO2 -5,000.06
I need to find all occurences of amounts that are negative and replace them with x's
78 ANGELO xxxxxxx
79... (4 Replies)
Hello All,
Plz help me with:
I have a csv file with data separated by ',' and optionally enclosed by "". I want to check each of these values to see if they exceed the specified string length, and if they do I want to cut just that value to the max length allowed and keep the csv format as it... (9 Replies)
I need to compare two files with exactly same length as example: -
File1 contain 500 records with length of 640 chars of each line.
File2 contain 1500 records with length of 640 chars of each line.
I need get an output to be written in File3 which will contain 1000 records difference.
but... (4 Replies)
HI
In my script, i am reading the input from the user and want to find the length of the string.
The input may contain leading spaces. Right now, when leading spaces are there, they are not counted.
Kindly help me
My script is like below. I am using the ksh.
#!/usr/bin/ksh
echo... (2 Replies)
Hello,
I really would appreciate some help with a bash script for some string manipulation on an SQL dump:
I'd like to be able to rename "sites/WHATEVER/files" to "sites/SOMETHINGELSE/files" within the sql dump.
This is quite easy with sed:
sed -e... (1 Reply)
I have two very large datasets (>100MB) in a simple vertical list format. They are of different size and with different order and formatting (e.g. whitespace and some other minor cruft that would thwart easy regex).
Let's call them set1 and set2.
I want to check set2 to see if it contains... (2 Replies)
Hi,
I have a program written in awk and I want to extend it to do another task.
My program is a list of CVS log reports of a repository. For each file, I have some fields. One of the fields is the comment field. I want to know how I can check if a comment (which is a free text field)... (8 Replies)
Hi All,
I have a file test.txt.
Content of test.txt :
1 vinay se
2 kumar sse
4 kishore tl
I am extracting the content of file with below command.
awk '$2 ~ "vinay" {print $0}' test.txt
Now instead of hardcoding $2 is there any way pass $2 as variable and compare with a... (7 Replies)
I have below code inside my awk script
if ( $0 ~ /SVC IN:/ )
{
svc_in=substr( $0,23 , 3);
if (msg_start == 1 && msg_end == 0)
{
msg_arr=$0;
}
}
else if ( $0 ~ /^SVC OUT:/ )
{
svc_out=substr( $0, 9, 3);
if (msg_start == 1 && msg_end == 0)
... (6 Replies)
Discussion started by: bhagya123
6 Replies
LEARN ABOUT DEBIAN
units-filter
UNITS-FILTER(1) units-filter User Manual UNITS-FILTER(1)NAME
units-filter - is a parser for physical and chemical quantities
SYNOPSIS
units-filter -s -o -l
DESCRIPTION
units-filter is a basic standalone parser written in C language, flex and bison. It inputs strings like "1.5e3 nN.m.s^-1" (it could be the
time growth ratio of a torque) and outputs the value in standard SI unit, followed by the physical dimension of this value.
OPTIONS -s
Like Significant.
Takes in account the number of significant digits. For example 1.0 m contains 2 significant digits, while 0.00100 contains 3
significant digits. It is possible to enforce the number of significant digits by using a special syntax : if units-filter parses the
input "1.0m#6", it interprets it as a value with exactly 6 significant digits, like "1.00000 m". The number following the # sign is the
forced number of significant digits. The number of significant digits appears just before the last zero in the output of the command
(this zero is a placeholder for future extensions).
-o
Like Output.
Outputs a correct representation of the physical quantity with its physical unit in the International System notation. There may be
some simplification with usual units. For example, a newton will be represented by the unit N in place of m.kg.s^-2. The value is
expressed as a floating number with one digit before the decimal point, and as many digits in the mantissa as necessary to fit the
desired number of significant digits (see an example below). It is possible to enforce the output unit : just add a colon and the
desired unit at the end of the input. If this unit is homogeneous with the former one, it will be used to format the output.
-l
Like LaTeX.
Outputs a correct representation of the physical quantity with its physical unit in the International System notation, in LaTeX
language.
EXAMPLES
Establish the SI value and unit exponent of a quantity in the mksa system:
~$ echo 1.5e3 nN.m.s^-1 | units-filter
1.5e-6 2 1 -3 0 0 0 0
which means : 1.5e-6 (SI unit) m^2.kg.s^-3
Compare different physical quantities:
~$ e1=$(echo "1.2e-3 V" | units-filter)
~$ e2=$(echo "1200e3 nWb/s"| units-filter)
~$ if [ "$e1" = "$e2" ]; then echo ok; else echo ko; fi
ok
... which emphasizes that webers by unit time are the same as volts.
Playing with the number of significant digits:
~$ echo "0.00100m" | src/units-filter -s
0.001 1 0 0 0 0 0 0 3 0
~$ echo "0.00100m #2" | src/units-filter -s
0.001 1 0 0 0 0 0 0 2 0
Giving a value for the relative precision:
~$ echo "1kV~2" | units-filter -o
1e+03 V +-2%
Turning on the LaTeX output:
~$ echo "1kohm+-2%" | units-filter -l
1 imes 10^{+03}, Omega pm 2,\%
Turning on the output of a canonical physical notation:
~$ echo "1.0 m.kg.s^-2 #7" | units-filter -o
1.000000e+00N
Choosing a non-standard unit for the output:
~$ echo 1800C:A.h| units-filter -o
5.000e-01 A.h
KNOWN BUGS
Few units out of the mksa system are successfully parsed.
AUTHOR
Georges Khaznadar <georgesk@ofset.org>
Wrote this manpage.
COPYRIGHT
Copyright (C) 2009 Georges Khaznadar
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or (at
your option) any later version published by the Free Software Foundation.
On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL.
units-filter 11/19/2011 UNITS-FILTER(1)