Sponsored Content
Top Forums Shell Programming and Scripting Help with number field manipulation Post 302634169 by inditopgun on Thursday 3rd of May 2012 02:20:53 AM
Old 05-03-2012
Help with number field manipulation

I have a comma separated file containing numbers, I would like to read the file and divide each number by 1024 and create an output file.

Input file :

Code:
50312.00,3434.05, ,3433.34,124344.00,434343.00, , ,

Output file:

Code:
49.13,3.35,3.35,0,12.05,424.16,0,0

Moderator's Comments:
Mod Comment Please click this link: How to use [code][/code] tags

Last edited by Scrutinizer; 05-03-2012 at 03:45 AM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Subtract 100 from first field in long list? Simple manipulation?

It sounds so easy to do. I have a file thats laid out like this.. number text text text text (etc about 15 times with various text fields) I want to take the first field, "number", subtract 100 from it, and then put it back in the file. a simple little manipulation of the first field in... (4 Replies)
Discussion started by: LordJezo
4 Replies

2. Shell Programming and Scripting

Sorting on two fields time field and number field

Hi, I have a file that has data in it that says 00:01:48.233 1212 00:01:56.233 345 00:09:01.221 5678 00:12:23.321 93444 The file has more line than this but i just wanted to put in a snippet to ask how I would get the highest number with time stamp into another file. So from the above... (2 Replies)
Discussion started by: pat4519
2 Replies

3. Shell Programming and Scripting

Count number of occurences of a character in a field defined by the character in another field

Hello, I have a text file with n lines in the following format (9 column fields): Example: contig00012 149606 G C 49 68 60 18 c$cccccacccccccccc^c I need to count the number of lower-case and upper-case occurences in column 9, respectively, of the... (3 Replies)
Discussion started by: s052866
3 Replies

4. Shell Programming and Scripting

date field manipulation

I have a data file. Seperated by "|". The 19 th filed is a date field that occurs like this 11/02/2001 i need to convert into the below format 2001-11-02 for e.g.. i/p o/p should be can somebody throw some light (5 Replies)
Discussion started by: dsravan
5 Replies

5. Shell Programming and Scripting

Adding total of first field for each number in the second field

Dears, I need a script or command which can find the unique number from the second filed and against that number it adds the total of first field . 17215630 , 0 907043 ,1 201050 ,10 394149 ,4 1964 ,9 17215630, 0 907043 ,1 201050, 10 394149 ,4 1964 ,9 1234234, 55 23 ,100 33 ,67 ... (2 Replies)
Discussion started by: shary
2 Replies

6. UNIX for Dummies Questions & Answers

Finding numbers in lines with strings and number and doing some manipulation

Hi, I want to write a script that does something like this: I have a file, in which in every line, there is a string of words, and followed by some space, a number. Now, I want to identify the line, which has the largest startFace number (say m=8118), take that number and add it to the... (2 Replies)
Discussion started by: super_commando
2 Replies

7. Shell Programming and Scripting

Line number based manipulation

Hi I have a case where I am grabbing patterns and subsequent lines using sed -n -e '/regex/{$!N;p;}' This returns just the regex line when it is the last line of my file. Now I may have even number of lines in some cases (regex never at end) and odd in very rare cases. If the line... (6 Replies)
Discussion started by: jamie_123
6 Replies

8. Shell Programming and Scripting

awk to find number in a field then print the line and the number

Hi I want to use awk to match where field 3 contains a number within string - then print the line and just the number as a new field. The source file is pipe delimited and looks something like 1|net|ABC Letr1|1530||| 1|net|EXP_1040 ABC|1121||| 1|net|EXP_TG1224|1122||| 1|net|R_North|1123|||... (5 Replies)
Discussion started by: Mudshark
5 Replies

9. Shell Programming and Scripting

Squence number manipulation in Shell

Hello Forum, I am receiving a file daily like ASAD but at the end there is a counter like 0012 (4 digits) so my every next file +1 I want to write a control script and check the last sequence number.Let's say If I receive a file ASAD0012 then after receiving this file I wan to say that... (5 Replies)
Discussion started by: cemokam65
5 Replies

10. UNIX for Beginners Questions & Answers

File manipulation place 0 before the number using sed

I'm new with sed, and i am really confused with slashes, backslashes, parentheses, I've tried reading some beginner's guide, but still trouble fixing this problem, do you have any tips where or what to read to learn more about sed? can you also help me with my problem? Note: I was tasked to use... (4 Replies)
Discussion started by: akopocpoypoy
4 Replies
AMDD(8) 						      System Manager's Manual							   AMDD(8)

NAME
amdd - Amanda version of dd SYNOPSIS
amdd [ -d ] [ if=input ] [ of=output ] [ bs=blocksize ] [ skip=count ] [ count=count ] DESCRIPTION
Amdd provides just enough of the standard dd command for the needs of Amanda. This is handy when doing a full restore and the standard dd program has not yet been found. Amdd also provides access to the Amanda output drivers that support various tape simulations. This may be used for debugging or to convert from one format to another. See the amanda(8) man page for more details about Amanda. See the OUTPUT DRIVERS section of amanda(8) for more information on the Amanda output drivers. OPTIONS
-d Turn on debugging output. -llength Set the output length. If the output driver limits the output size, this controls when end of tape will be simulated. Length may have a multiplier suffix: k 1024 (Kilobytes) b 512 (Blocks) M 1024*1024 (Megabytes) The default is no multipler (bytes). if=input Input to dd. Default is stdin. of=output Where to send the output of dd. Default is stdout. bs=blocksize Size of each record. Input records smaller than this will not be padded. Output records will be the same size as the corresponding input record. Default is 512 bytes. Blocksize may have a multiplier suffix: k 1024 (Kilobytes) b 512 (Blocks) M 1024*1024 (Megabytes) The default is no multipler (bytes). count=count Number of records to copy. Default is all records until end of file. skip=count Number of records to skip before copying input to output. Default is zero. AUTHOR
Marc Mengel <mengel@fnal.gov> John R. Jackson <jrj@purdue.edu> SEE ALSO
amanda(8) AMDD(8)
All times are GMT -4. The time now is 08:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy