10-04-2009
Quote:
Originally Posted by
diksha2207
Hi
I need further help on the issue posted by gpaulose. I need awk command to append a string at the end of the lines in a text file where a certain string match is found. I am using grep to find a match in the file and then appending.
I am using sed command at present. But the file size is huge and there are 100s of such files. So sed is taking too much time.
Can someone tell me the awk command to append a string at the end of line where a certain string match s found. Performance is very important here.
Thanks
Welcome to the forums !
Please read the rules of the forum.
This should have been a new post.
Please post us what you had tried so far.
9 More Discussions You Might Find Interesting
1. Solaris
hi,
i installed solaris 9 on my v240 server on 36gb disk. here are the ouputs of the df -h command:
# df -h
Filesystem size used avail capacity Mounted on
/dev/dsk/c1t0d0s0 9.6G 3.4G 6.1G 36% /
/proc 0K 0K 0K 0% /proc
mnttab ... (6 Replies)
Discussion started by: xuc_xich_duc
6 Replies
2. News, Links, Events and Announcements
About 4 years ago I wrote this tool inspired by Rob Urban's collect tool for DEC's Tru64 Unix. What makes this tool as different as collect was in its day is its ability to run at a low overhead and collect tons of stuff. I've expanded the general concept and even include data not available in... (0 Replies)
Discussion started by: MarkSeger
0 Replies
3. UNIX for Advanced & Expert Users
hello experts,
i am trying to replace a line in a 100+mb text file. the structure is similar to the passwd file, id:value1:value2 and so on. using the sed command
sed -i 's/\(123\):\(\{1,\}\):/\1:bar:/' data.txt
works nicely, the line "123:foo:" is replaced by "123:bar:". however, it takes... (7 Replies)
Discussion started by: f3k
7 Replies
4. Shell Programming and Scripting
I have written a code using AWK & sed to compare two files.
The structure of the files is like this"
Format is this:
<bit code> <file code> <string>
Follwoed by any numbers of properties lines whic start with a "space"
10101010101111101 XX abcd a
AS sasa
BS kkk
1110000101010110 XX... (1 Reply)
Discussion started by: sandeep_hi
1 Replies
5. AIX
Hi,
I have a 10GB iSCSI LUN attached to an AIX 5.3 system. I increased the LUN to 15GB, but the system is still showing 10GB as the Total Size.
How can I get the OS to see the extra space? Do I have to reboot the system? (2 Replies)
Discussion started by: bbbngowc
2 Replies
6. Shell Programming and Scripting
I'm searching the most effective way of doing the following task, so if someone can either provide a working solution with sed or one totally different but more effective then what I've got so far then please go ahead!
The debugme directory has 3 subdirectorys and each of them has one .txt file... (7 Replies)
Discussion started by: TehOne
7 Replies
7. UNIX for Dummies Questions & Answers
Hi Guys,
I've wondered for some time the performance analysis between using sed and awk. say i want to print lines from a very large file. For ex say a file with 100,000 records. i want to print the lines 25,000 to 26,000 i can do so by the following commands:
sed -n '25000,26000 p'... (11 Replies)
Discussion started by: Irishboy24
11 Replies
8. Shell Programming and Scripting
I have a fasta file like this one:
>ID1
AAAAAA
>ID2
TTTTTT
And I am using this sed script to increase the count sequence
sed '/^>/s/.*//;/^$/=;/^$/d' text.txt | sed 's/.*/echo ">seq" \$(( ( & + 1 )\/2 ))/e'
I get the desired output:
>seq 1
AAAAAA
>seq 2
TTTTTT
However, this... (9 Replies)
Discussion started by: Xterra
9 Replies
9. Shell Programming and Scripting
I'm trying to exclude 'BACKUP', 'STORE', 'LOGGER' folders while searching for all files under a directory "/tmp/moht"
Once a file is found I wish to display the filename, the size of the file & the cksum value.
Below is the command, I'm using:
/opt/freeware/bin/find /tmp/moht -type d -name... (6 Replies)
Discussion started by: mohtashims
6 Replies
NWBPSET(1) nwbpset NWBPSET(1)
NAME
nwbpset - Create a bindery property or set its value
SYNOPSIS
nwbpset [ -h ] [ -S server ] [ -U user name ] [ -P password | -n ] [ -C ]
DESCRIPTION
nwbpset Reads a property specification from the standard input and creates and sets the corresponding property. The format is determined by
the output of 'nwbpvalues -c'. nwbpset will hopefully become an important part of the bindery management suite of ncpfs, together with
As another example, look at the following command line:
nwbpvalues -t 1 -o supervisor -p user_defaults -c |
sed '2s/.*/ME/'|
sed '3s/.*/LOGIN_CONTROL/'|
nwbpset
With this command, the property user_defaults of the user object 'supervisor' is copied into the property login_control of the user object
'me'.
nwbpvalues -t 1 -o me -p login_control -c |
sed '9s/.*/ff/'|
nwbpset
This command disables the user object me.
Feel free to contribute other examples!
nwbpset looks up the file $HOME/.nwclient to find a file server, a user name and possibly a password. See nwclient(5) for more information.
Please note that the access permissions of $HOME/.nwclient MUST be 600 for security reasons.
OPTIONS
-h
-h is used to print out a short help text.
-S server
server is the name of the server you want to use.
-U user
user is the user name to use for login.
-P password
password is the password to use for login. If neither -n nor -P are given, and the user has no open connection to the server, nwbpset
prompts for a password.
-n
-n should be given if no password is required for the login.
-C
By default, passwords are converted to uppercase before they are sent to the server, because most servers require this. You can turn off
this conversion by -C.
AUTHORS
nwbpset was written by Volker Lendecke. See the Changes file of ncpfs for other contributors.
nwbpset 8/7/1996 NWBPSET(1)