Sponsored Content
Top Forums Shell Programming and Scripting How to change a number on a specific line with cshell or shell? Post 302610913 by miriammiriam on Thursday 22nd of March 2012 03:12:18 AM
Old 03-22-2012
Thanks for the answer Smilie

But when I type the code it gives error:

Code:
sezim@localhost#BEGIN { A["FRR1"]=0.11; A["FRR4"]=0.13 }
BEGIN: No match.
A[FRR4]=0.13: No match.
sezim@localhost#
sezim@localhost#A[$1] {
A[]: Command not found.
sezim@localhost#        V=substr($0, 24, 5);
Badly placed ()'s.
sezim@localhost#        V += A[$1]
V: Command not found.
sezim@localhost#        $0=substr($0, 0, 23) sprintf("%5s", V) substr($0, 29);
Badly placed (.
sezim@localhost#}
}: Command not found.
sezim@localhost#
sezim@localhost#1
1: Command not found.
sezim@localhost#
sezim@localhost# awk -f addfr.awk data
awk: addfr.awk:20640: fatal: cannot open file `data' for reading (No such file or directory)

I did not understand why it did not worked I think there is something wrong with BEGIN or maybe the syntax

I tried a couple of different syntax but it did not change the result...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Adding a columnfrom a specifit line number to a specific line number

Hi, I have a huge file & I want to add a specific text in column. But I want to add this text from a specific line number to a specific line number & another text in to another range of line numbers. To be more specific: lets say my file has 1000 lines & 4 Columns. I want to add text "Hello"... (2 Replies)
Discussion started by: Ezy
2 Replies

2. UNIX for Dummies Questions & Answers

Change Specific Line of a File

Hi everyone, I am attempting to do something that should be very simple. How do I replace a specific line of a file with different text, and then save that file to its original name? I believe I want to use the sed command with the c option, but I after trying many times, I can't get the right... (10 Replies)
Discussion started by: msb65
10 Replies

3. Shell Programming and Scripting

using sed to replace a specific string on a specific line number using variables

using sed to replace a specific string on a specific line number using variables this is where i am at grep -v WARNING output | grep -v spawn | grep -v Passphrase | grep -v Authentication | grep -v '/sbin/tfadmin netguard -C'| grep -v 'NETWORK>' >> output.clean grep -n Destination... (2 Replies)
Discussion started by: todd.cutting
2 Replies

4. Shell Programming and Scripting

How would i delete a line at specific line number

Hi guys , I m writing a script to delete a line at particular location. But i m unable to use variable for specifying line number. for example. sed -n '7!p' filename works fine and deletes 7th line from my file but sed -n '$variable!p' filename gives following error. sed: -e... (12 Replies)
Discussion started by: pinga123
12 Replies

5. Programming

Cshell help with change colour in print

i want to ask how to change the colour of prompt message from use? and also how to change colour in printing........ i want to change it as blue colour and red colour, but i found many website still don't know how to do. how's the command is wrote? thz really!! (1 Reply)
Discussion started by: wendy1089
1 Replies

6. Shell Programming and Scripting

How to read from specific line number in shell script?

I have a text file which is having 30000 lines in it. I have to create a xml file for each 10000 lines until all the lines in the text files are written. Also please help how can i get number of lines in the text file in a shell variable? (19 Replies)
Discussion started by: vel4ever
19 Replies

7. Shell Programming and Scripting

new line after specific number character

Hi All, I have input file like this: input1: ( 1083479)=T 158V 1798, T 391V 1896,T 1138V 2273,T 1547V 2477,T 2249V 2917,T 3278V 3234,T 4152V 3495,T 5500V 3631, ( 1083501)=T 181V 1851, T 459V 1954,T 810V 2141,T 1188V 2372,T 1638V 2696,T 2731V 3124,T 4799V 3640,... (5 Replies)
Discussion started by: attila
5 Replies

8. Shell Programming and Scripting

How to change a number on a specific lines in a file with shell?

Hello My problem is that I want to change some specific numbers in a file. It is like, 2009 10 3 2349 21.3 L 40.719 27.388 10.8 FRO 7 0.8 1.1LFRO 2.6CFRO 1.1LMAM1 GAP=157 1.69 5.7 5.9 5.8 0.5405E+01 0.4455E+00 0.1653E+02E STAT SP IPHASW D HRMM SECON CODA AMPLIT... (11 Replies)
Discussion started by: miriammiriam
11 Replies

9. Shell Programming and Scripting

Cut from specific line number to a line number

Hi All, I've a file like this.. Sheet1 a,1 a,2 a,3 a,4 a,5 Sheet2 a,6 a,7 a,8 a,9 a,10 Sheet3 a,11 a,12 a,13 (7 Replies)
Discussion started by: manab86
7 Replies

10. Shell Programming and Scripting

sed command to replace a line at a specific line number with some other line

my requirement is, consider a file output cat output blah sdjfhjkd jsdfhjksdh sdfs 23423 sdfsdf sdf"sdfsdf"sdfsdf"""""dsf hellow there this doesnt look good et cetc etc etcetera i want to replace a line of line number 4 ("this doesnt look good") with some other line ... (3 Replies)
Discussion started by: vivek d r
3 Replies
KUMO-SERVER(1)						      General Commands Manual						    KUMO-SERVER(1)

NAME
kumo-server - kumofs server daemon SYNOPSIS
kumo-server -m <addr[:port=19700]> -p <addr[:port19700]> -l <addr[:port=19800]> -s <path.tch> DESCRIPTION
kumo-server stores actual data. You can add kumo-servers after buiding the cluster. You can get live status of the kumo-manager using kumostat and kumotop command. OPTIONS
-l <addr[:port=19800]> --listen listen address -L <port=19900> --stream-listen listen port for replacing stream -f <dir=/tmp> --offer-tmp path to temporary directory for replacing -s <path.tch> --store path to database -m <addr[:port=19700]> --manager1 address of manager 1 -p <addr[:port=19700]> --manager2 address of manager 2 -S <number=20> --replicate-set-retry replicate set retry limit -D <number=20> --replicate-delete-retry replicate delete retry limit -gN <seconds=60> --garbage-min-time minimum time to maintenance deleted key -gX <seconds=3600> --garbage-max-time maximum time to maintenance deleted key -gS <kilobytes=2048> --garbage-mem-limit maximum memory usage to memory deleted key -k <number=2> --keepalive-interval keepalive interval in seconds -Ys <number=1> --connect-timeout connect timeout time in seconds -Yn <number=4> --connect-retry-limit connect retry limit -Ci <number=8> --clock-interval clock interval in seconds -TW <number=2> --write-threads number of threads for asynchronous writing -TR <number=4> --read-threads number of threads for asynchronous reading -o <path.log> --log output logs to the file -g <path.mpac> --binary-log enable binary log -v --verbose -d <path.pid> --daemon EXAMPLE
[on svr1 ]$ kumo-server -v -l svr1 -m mgr1 -p mgr2 -s /var/kumodb.tch -gN 5 -gS 20480 [on svr2 ]$ kumo-server -v -l svr2 -m mgr1 -p mgr2 -s /var/kumodb.tch -TR 6 -TW 4 [on svr3 ]$ kumo-server -v -l svr3 -m mgr1 -p mgr2 -s /var/kumodb.tch -Ci 16 [localhost]$ kumo-server -v -m localhost -l localhost:19801 -L 19901 -s ./database1.tch [localhost]$ kumo-server -v -m localhost -l localhost:19802 -L 19902 -s ./database2.tch [localhost]$ kumo-server -v -m localhost -l localhost:19803 -L 19902 -s ./database3.tch SEE ALSO
kumostat(1), kumotop(1), kumolog(1), kumomergedb(1), kumohash(1). kumo-server July 2009 KUMO-SERVER(1)
All times are GMT -4. The time now is 04:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy