Sponsored Content
Full Discussion: Extracting values from files
Top Forums Shell Programming and Scripting Extracting values from files Post 54464 by Master Error on Saturday 14th of August 2004 05:09:08 PM
Old 08-14-2004
Thats great Smilie

but if u don't mind could u break that down for me so i can understand what the codes are doing ...

just these two steps

Quote:
if [ ! `cat formula.txt | cut -d ' ' -f 1 | grep "$code"` ];

Quote:
awk '$1 == "'"$code"'" { print '"$value"' * $2 }' formula.txt
sorry still a beginner, so id much rather learn then copy..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extracting dynamic values

Hi, I am stuck with extracting values by combining 2 dynamically extracted values. The code goes like this #!/usr/bin/ksh ID1="abcd" i=1 #this is a dynamic value and keeps on changing b="ID" #this is static now i want the value of ID1 variable. like echo $b$i But echo... (1 Reply)
Discussion started by: chaitanyapn
1 Replies

2. Shell Programming and Scripting

Extracting the values separated by comma

Hi, I have a variable which has a list of string separated by comma. for ex , Variable=/usr/bin,/usr/smrshbin,/tmp How can i get the values between the commas separately using shell scripts.Please help me. Thanks, Padmini. (6 Replies)
Discussion started by: padmisri
6 Replies

3. UNIX for Dummies Questions & Answers

Extracting values from an XML file

Hello People, I have an xml file from which I need to extract the values of the parameters using UNIX shell commands. Ex : Input is like : <Name>Roger</Name> or <Address>MI</Address> I need the output as just : Roger or MI with the tags removed. Please help. (1 Reply)
Discussion started by: sushant172
1 Replies

4. Shell Programming and Scripting

extracting values from configuration file

Dear All, i am new to shell scripting, I am working on embedded system based on linux.I am supposed to the read the configuration file and edit another file. presently I would like to read from the configuration file.It would be having values file one below. There is chance of entering... (6 Replies)
Discussion started by: Ratheendran
6 Replies

5. Shell Programming and Scripting

Extracting fetching values

I have a file like this ############################################ # ParentFolder Flag SubFolders Colateral 1 Source1/Checksum CVA 1 Source1/Checksum Test 1 VaR/Checksum Test2 1 SVaR/Checksum FX 1 ... (6 Replies)
Discussion started by: manas_ranjan
6 Replies

6. UNIX for Dummies Questions & Answers

extracting values from file using perl

I would like to read value after $ symbol from a file. For eg a file will be having the following lines. 5,$0,-32768p,32767p,$400014f8,1,, 5,$0,0,0,$400008ce,1,, 5,$0,0,0,$400008d0,1,, i would like to read 400014f8 then 400014f8 and similar all the value after $ symbol.Can any one help... (1 Reply)
Discussion started by: jagadeeshrr
1 Replies

7. Shell Programming and Scripting

Extracting field values from .csv

How can I select the bold fields from the following? "CLLI","SWREL","RPTDATE","RPTIME","TZ","RPTTYPE","RPTPD","IVALDATE","IVALSTART","IVALEND","NUMENTIDS" "tklc9010801","EAGLE5 45.0.0-64.70.1","2013-08-07","02:01:50","MST ","COMPONENT MEASUREMENTS ON... (4 Replies)
Discussion started by: leghorn
4 Replies

8. Shell Programming and Scripting

Extracting values based on line-column numbers from multiple text files

Dear All, I have to solve the following problems with multiple tab-separated text file but I don't know how. Any help would be greatly appreciated. I have access to Linux mint (but not as a professional). I have multiple tab-delimited files with the following structure: file1: 1 44 2 ... (5 Replies)
Discussion started by: Bastami
5 Replies

9. Shell Programming and Scripting

Taking key values from one file and extracting values from another file

Hi, I have two files with values in both. File1: cat 2 3 dog 4 5 elephant 6 7 camel 2 3 File2: ----+--gkf;ajf= ---+---- +----- cat -------=----+ 3 | 4 ----- dog ------++-- 5 | 9 ----++-- elephant | 5 | 7 ---++ camel ------ ++++_---- || 8 | 9 I want the final file as: cat 4... (1 Reply)
Discussion started by: npatwardhan
1 Replies

10. Shell Programming and Scripting

Extracting and comparing values

I was trying to extract value of g1 and p1 only inside the tags where t1 is "Reading C (bytes)" and comparing them to make sure p1 is always less than g1. Here is the Json file I'm using - File:- { "g1" : 1482568, "n1" : "v_4", "p1" : 0, "s1" : "RC", "t1" : "LM", } { "g1" :... (3 Replies)
Discussion started by: Mannu2525
3 Replies
XmConvertUnits(3X)														XmConvertUnits(3X)

NAME
XmConvertUnits - A function that converts a value in one unit type to another unit type SYNOPSIS
#include <Xm/Xm.h> int XmConvertUnits (widget, orientation, from_unit_type, from_value, to_unit_type) Widget widget; int orientation; int from_unit_type; int from_value; int to_unit_type; DESCRIPTION
XmConvertUnits converts the value and returns it as the return value from the function. Specifies the widget for which the data is to be converted Specifies whether the converter uses the horizontal or vertical screen resolution when performing the conversions. orientation can have values of XmHORIZONTAL or XmVERTICAL. Specifies the current unit type of the supplied value Specifies the value to be converted Converts the value to the unit type specified The parameters from_unit_type and to_unit_type can have the following values: XmPIXELS--all values provided to the widget are treated as normal pixel values. This is the default for the resource. Xm100TH_MILLIMETERS--all values provided to the widget are treated as 1/100 millimeter. Xm1000TH_INCHES--all values provided to the widget are treated as 1/1000 inch. Xm100TH_POINTS--all values provided to the widget are treated as 1/100 point. A point is a unit typically used in text processing applications and is defined as 1/72 inch. Xm100TH_FONT_UNITS--all values provided to the widget are treated as 1/100 of a font unit. A font unit has horizontal and vertical compo- nents. These are the values of the XmScreen resources XmNhorizontalFontUnit and XmNverticalFontUnit. RETURN VALUE
Returns the converted value. If a NULL widget, incorrect orientation, or incorrect unit_type is supplied as parameter data, 0 is returned. SEE ALSO
XmSetFontUnits(3X), XmScreen(3X) XmConvertUnits(3X)
All times are GMT -4. The time now is 09:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy