Sponsored Content
Top Forums Shell Programming and Scripting Replacing certain fields from certain rows Post 302514556 by bartus11 on Saturday 16th of April 2011 05:32:08 PM
Old 04-16-2011
Try:
Code:
awk 'NR>5&&NR<9{$2+=0.1}1' file

This User Gave Thanks to bartus11 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extract duplicate fields in rows

I have a input file with formating: 6000000901 ;36200103 ;h3a01f496 ; 2000123605 ;36218982 ;heefa1328 ; 2000273132 ;36246985 ;h08c5cb71 ; 2000041207 ;36246985 ;heef75497 ; Each fields is seperated by semi-comma. Sometime, the second files is... (6 Replies)
Discussion started by: anhtt
6 Replies

2. Shell Programming and Scripting

Specifying and replacing fields with awk

#cat BATCH007.TXT 01,661060052,061000104,081118,0915,07,80,1,2/ 99,,,2/ I have this file called BATCH007.TXT. I am trying to change fields 2 and 3 on line 2 to have zeroes. Like this: 01,661060052,061000104,081118,0915,07,80,1,2/ 99,0,0,2/ I can use these commands to print identify the... (2 Replies)
Discussion started by: ddurden7
2 Replies

3. Shell Programming and Scripting

Matching fields of rows and then operating

Hi All, I was seaching for script for solaris 5.10 environmet to get a output file from Input file like this. INPUT FILE---------------- 1000KE,MINE,74748 1000KE,YOUR,123998 200KE,MINE,886049 50KE,MINE,474176 50KE,YOUR,379998 100KE,YOUR,999994 50KE,MINE,9601 50KE,YOUR,990393... (3 Replies)
Discussion started by: ashis.tewari
3 Replies

4. UNIX for Dummies Questions & Answers

Finding & Replacing specific Fields

All I have a very large file (aproximately 150,000) as shown below separated by pipe "|". I need to replace data in 2, 16, 17, 23 fields that are of time stamp format. My goal is to look in those fields and it ends with "000000|" then replace it with "000|". In other words, make it as 6 digit... (2 Replies)
Discussion started by: ddraj2015
2 Replies

5. Shell Programming and Scripting

Comparing two files and replacing fields

I have two files with ids and email addresses. File 2 cotains a subset of the records in file 1. The key field is the first field containing the id. file 1: 123|myadr@abc.com 456|myadr2@abc.com 789|myadr3@abc.com file 2: 456|adr456@xyz.com Where the record appears in the second... (3 Replies)
Discussion started by: tltroy
3 Replies

6. Shell Programming and Scripting

Replacing fields

Hi! I have a file somefile.txt: 12, 1, a, b, c, d, e, f 12, 1, a, b, c, d, e, f 17, 51, a, b, c, d, e, f ... I've made this script to read two fields from a line and output a third: cat somefile.txt | awk -F, '{if ($1 == "12" && $2== "1") print "19"; else if ($1 == "17" && $2== "51")... (8 Replies)
Discussion started by: Tr0cken
8 Replies

7. Shell Programming and Scripting

Remove rows with first 4 fields duplicated in awk

Hi, I am trying to use awk to remove all rows where the first 4 fields are duplicates. e.g. in the following data lines 6-9 would be removed, leaving one copy of the duplicated row (row 5) Borgarhraun FH9822 ol24 FH9822_ol24_m20 ol Deformed c Borgarhraun FH9822 ol24 ... (3 Replies)
Discussion started by: tomahawk
3 Replies

8. Shell Programming and Scripting

Extract fields from different rows.

Hi, I have data like below. SID=D6EB96CC0 HID=9C246D6 CSource=xya Cappe=1 Versionc=3670 MAR1=STL MARS2=STL REQ_BUFFER_ENCODING=UTF-8 REQ_BUFFER_ORIG_ENCODING=UTF-8 RESP_BODY_ENCODING=UTF-8 CON_ID=2713 I want to select CSource=xya (18 Replies)
Discussion started by: chetan.c
18 Replies

9. Shell Programming and Scripting

awk to grep rows by multiple fields

Hello, I met a challenge to extract part of the table. I'd like to grep the first three matches based on field1 and field2. Input: D A 92.85 1315 83 11 D A 95.90 757 28 3 D A 94.38 480 20 7 D A 91.21 307 21 6 D A 94.26 244 ... (6 Replies)
Discussion started by: yifangt
6 Replies

10. Shell Programming and Scripting

Swapping/replacing fields

Hallo Team, I would like to replace filed 4 and 7 with filed 39 how can i achieve this ? -bash-3.2$ cat dip1.csv| cut -f4,7,24,36,39 -d","|sort -u +27113996891,+27113996891,196.35.130.52,828854047,+27873500077 +27116452690,+27825702918,10.0.109.13:5060,+27116452690,+27116452690... (2 Replies)
Discussion started by: kekanap
2 Replies
NFADMIN(8)						      System Manager's Manual							NFADMIN(8)

NAME
nfadmin - Change the status of a set of Notesfiles SYNOPSIS
nfadmin flags topic [ topic ... ] nfadmin flags -f listfile DESCRIPTION
Nfadmin simplifies the task of displaying and setting director page options of many notesfiles at once. The flags specify the status to be changed. -a+ Allow anonymous submissions. -a- Disallow anonymous submissions. -n+ Allow network transmissions/receptions. -n- Disallow network transmissions/receptions. -o+ Open the notesfile. Allow local access by non-directors (subject to access permissions). -o- Close the notesfile. Disallow local access by non-directors. -A+ Flag this notesfile as an archive notesfile. (This does NOT mean that the notesfile will be archived. You can't archive an ar- chive!) -A- Flag this notesfile as a non-archive notesfile. This does not affect what happens to notes when they expire. -M+ Flag this notesfile as a moderated notesfile. This causes commands that create new notes or responses to create a mail message to the newsgroup moderator instead. A list of notesfiles and the mail address of the moderator is maintained in /usr/spool/notes/.utilities/moderators. -M- Flag this notesfile as a non-moderated notesfile. -L+ Flag this notesfile as a local notesfile. Local notesfiles don't ask whether to include a .signature file at the end of a new note or response. -L- Flag this notesfile as a non-local notesfile. If the NFSIG environment variable is set, notes will prompt whether or not to include the signature file named by NFSIG at the end of a new note or response. -e=NN Set the expiration time of this notesfile to NN days. (NN should be replaced with a positive number). -e=0 Set the expiration time of this notesfile to DEFAULT. The number specified on the nfarchive command line will be used to determine expiration time. If no time is specified on the nfarchive command line, 14 days is used. -e=-1 Set the expiration time of this notesfile to NEVER. -W=0 Set the working set size of this notesfile to the command line default. -W=NN Set the working set size of this notesfile to NN. -l=NNNNN Set the maximum note size of an individual note in this notesfile to NNNNN. (Warning: negative numbers and numbers under 1000 are a very bad idea here. The usual notes default of 100000 is too small for sources groups and mod.map. Please consider raising the limit for these groups to something more reasonable, like 500000 or 2000000. Also check your parms.h file; notes has a "hard limit", and if you set the maximum size over the hard limit, the hard limit still applies, even though the individual maximum is still displayed). -E=default Set the expiration action of this notesfile to the command line default. -E=delete Set the expiration action of this notesfile to DELETE. -E=archive Set the expiration action of this notesfile to ARCHIVE -D=default Set the director message status of this notesfile to the command line default. -D=on Set the director message status of this notesfile to ON; only notes with the director message ON will be removed by nfarchive. -D=off Set the director message status of this notesfile to OFF; only notes with the director message OFF will be removed by nfarchive. -D=nocare Set the director message status of this notesfile to NOCARE; the director message flag is not used by nfarchive in selecting notes for archive/deletion. -f file The file specified in the argument following the -f flag contains a series of lines, each specifying a notesfile or group of notes- files (wildcard) to be displayed or changed. If no flags are specified (except possibly -f), no changes are made, but the current state of the notesfiles is displayed. If flag(s) are specified, the new state after the changes is displayed, in the following format: notesfile title NetW Open Anon Arch WSet Arch. Keep DirM # Max -------status------ Size Time Actn Stat Notes Size net.bugs.2bsd : YES YES NO NO 0 12 ARCH DFLT 3 500000 net.bugs.4bsd : YES YES NO NO 2 12 ARCH DFLT 26 500000 net.bugs.usg : YES YES NO NO 0 12 ARCH DFLT 8 500000 net.bugs.uucp : YES YES NO NO 0 12 ARCH DFLT 9 500000 net.bugs.v7 : YES YES NO NO 2 12 ARCH DFLT 1 500000 nfmaint : YES YES NO NO 0 NEVER DEL DFLT 3 500000 nfgripes : YES YES NO NO 0 14 DEL DFLT 0 500000 net.micro.6809: NO YES NO NO 0 1 DEL DFLT 0 500000 net.announce : YES YES NO NO 0 DFLT ARCH DFLT 0 500000 (The output has been squished slightly to allow it to fit in the manual page format). All users are allowed to run this program. The changes are only applied to notesfiles for which the executing user is a director. This program lives in the notesfile utility directory, typically ``/usr/spool/notes/.utilities''. EXAMPLES
nfadmin -n+ -o+ -a- -e=14 "net.*" nfadmin -o- -f noteslist In the first example, all of the net.* notesfiles are set to networked, open, non-anonymous, with an expiration time of 14 days. The sec- ond example closes access to non-directors for all of the files listed in the file "noteslist". BUGS
More parameters ought to be changable with this program. Nfadmin has not been tested with systems that can have notesfile names longer than 14 characters. The nfadmin code does not have such dependencies except in the output format, but the columns may look ugly. Nfadmin will probably stop working when a certain news administrator creates newsgroup names larger than any of the PDP-11 max data space (64k), the maximum argument/environment to exec (something around 10k), or the total amount of virtual memory on your machine. FILES
/usr/spool/notes the default notesfile data base SEE ALSO
mknf(8), notes(1), nfcomment(3), The Notesfile Reference Manual AUTHORS
Gordon Burditt (sneaky!gordon) Tandy Systems Design created this program using the Notesfiles system by Ray Essick (uiucdcs!essick, essick%uiuc@csnet-relay.arpa) University of Illinois at Urbana-Champaign Urbana, IL as a base. University of Illinois NFADMIN(8)
All times are GMT -4. The time now is 08:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy