Sponsored Content
Top Forums Shell Programming and Scripting SUM semicolon-seperated values from txt-file Post 302936970 by milu on Monday 2nd of March 2015 09:58:35 AM
Old 03-02-2015
SUM semicolon-seperated values from txt-file

Hello,

(I'm a shell beginner)
how can I sum the bold values of the following txt-file (values.txt) with bash shell. The result of the sum should be written in a new txt file (sum.txt):

Quote:
0;tables;19;02;2015;E;Z; 2.00;
1;tables;19;02;2015;E;ZEW; 137.10;
0;tables;01;02;2015;E;HAS; 37.50;
...

Thanks in advance

Last edited by milu; 03-02-2015 at 11:18 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to load comma seperated values file (*.csv) into Oracle table

Hi all I need to input values in a .csv file into my Oracle table running in Unix, I wonder what would be the command to do so... The values are recorded in an excel file and I tried using a formatted text file to do so but failed because one of the field is simply too large to fit in the... (5 Replies)
Discussion started by: handynas
5 Replies

2. UNIX for Advanced & Expert Users

How to load comma seperated values file (*.csv) into Oracle table

Hi all I need to input values in a .csv file into my Oracle table running in Unix, I wonder what would be the command to do so... The values are recorded in an excel file and I tried using a formatted text file to do so but failed because one of the field is simply too large to fit in the... (4 Replies)
Discussion started by: handynas
4 Replies

3. Shell Programming and Scripting

Comma Seperated List of Values

Hi, I have a comma seperated list of values: export list="red,blue,white,yellow" Given a value in a variable "look", i want to check whether the value is available in the above list. But the result should be based on exact string match and not part of the string. I am using following... (9 Replies)
Discussion started by: brap45
9 Replies

4. Shell Programming and Scripting

Removing blank lines from comma seperated and space seperated file.

Hi, I want to remove empty/blank lines from comma seperated and space seperated files Thanks all for help (11 Replies)
Discussion started by: pinnacle
11 Replies

5. Shell Programming and Scripting

Compare semicolon seperated data in 2 files using shell script

hello members, I have some data ( seperated by semicolon ) with close to 240 rows in a text file temp1. temp2.txt stores 204 rows of data ( seperated by semicolon ). I want to : Sort the data in both files by field1.i.e first data field in every row. compare the data in both files and print... (6 Replies)
Discussion started by: novice82
6 Replies

6. Shell Programming and Scripting

Convert comma seperated file to line seperated.

Hi, I have data like this. 1,2,3,4 Output required: 1 2 3 4 I am trying to use tr function but getting error. Help is appreciated. (6 Replies)
Discussion started by: pinnacle
6 Replies

7. Shell Programming and Scripting

Taking sum up all values inside the file

Hi, Taking sum up all values inside the file by using the below command: paste -sd+ filenmae | bc Getting some error like "0705-001: building space exceeded on line1 stdin" The original data looks like SPACE SPACE SPACE 0.123 JOBNAME1 SPACE SPACE 20.325 JOBNAME2 SPACE SPACE... (2 Replies)
Discussion started by: NareshN
2 Replies

8. Shell Programming and Scripting

Get the sum of values in between begin and end in the file

Hi All, test file Begin Script Run at Thu Mar 14 09:24:16 PDT 2013 tst_accounts: ws zip: WS_out_20130313.tar.gz dat: test_20130313.dat count: 63574 loaded: xx pre-merge: xx post-merge: xx timestamp: Thu Mar 14 09:30:42 PDT 2013 tst_accounts: ws zip: WS_out_20130313.tar.gz dat: s_20130313.dat... (6 Replies)
Discussion started by: bmk
6 Replies

9. Shell Programming and Scripting

Replace semicolon within double quotes in a file with semicolon delimiter

Hello Team, Could you please help me with the below question? I have a file with the following properties 1) File Delimiter is ; 2) Text columns are within double quotes 3) Numeric columns will not have double quotes 4) File has total 6 columns Please see a sample record from file ... (3 Replies)
Discussion started by: sam99
3 Replies

10. Shell Programming and Scripting

Seperated a Column from 'ESC' Character seperated file

Hi Experts I have an escape seperated fields in the unix file. And in the below format file I need to extract the first column. Please help its urgent. cat -v op.dat | head 24397028^ I want to extract the file in below format ( with only first column ) 24397028 2439707 thanks. ... (6 Replies)
Discussion started by: neha_suri06
6 Replies
GETTABLE(8)						      System Manager's Manual						       GETTABLE(8)

NAME
gettable - get NIC format host tables from a host SYNOPSIS
/usr/sbin/gettable [ -v ] host [ outfile ] DESCRIPTION
Gettable is a simple program used to obtain the NIC standard host tables from a ``nicname'' server. The indicated host is queried for the tables. The tables, if retrieved, are placed in the file outfile or by default, hosts.txt. The -v option will get just the version number instead of the complete host table and put the output in the file outfile or by default, hosts.ver. Gettable operates by opening a TCP connection to the port indicated in the service specification for ``nicname''. A request is then made for ``ALL'' names and the resultant information is placed in the output file. Gettable is best used in conjunction with the htable(8) program which converts the NIC standard file format to that used by the network library lookup routines. SEE ALSO
intro(3N), htable(8), named(8) BUGS
If the name-domain system provided network name mapping well as host name mapping, gettable would no longer be needed. 4.2 Berkeley Distribution November 17, 1996 GETTABLE(8)
All times are GMT -4. The time now is 01:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy