Thanks for your reply.I am felxible to anything if it is AWK or sed.
Please find the below details about the environment which i am using.
Os AIX and /usr/bin/ksh
If you need full log it's too big.If you need it i can provide you.The fomat which i sent it right format.No any other changes in the format.
search string:
rt920test.info53.com and 22025 are variables which i am passing through command promt.so these values are not fixed and the log file is also not fixed.
Replace string:
But the code which was provided is working for the sample input which i given.
Please let me know if you need any more details.
Is the source that is producing hostsocket.txt a windows system? You never said anything before about having <carriage-return><newline> as your line terminator (rather than the standard UNIX <newline> by itself) before. Your sample file didn't have any <carriage-return> characters in it.
Are you copying our suggested code onto your system using an editor that uses <carriage-return><newline> instead of <newline> as line terminators? If so, it is no wonder that none of our code is working for you on AIX.
Does your input file really contain <carriage-return> characters?
Do you really want <carriage-return> characters in the output?
Do you want the script to remove the trailing circumflex characters as shown in your first example?
Do you want the script to add lines as shown in your first example?
To identify the line to be changed, which of the following do we need to match at the start of a line:
(where <carriage-return> is a visual representation of the single-byte carriage return character)? If it is one of the first two above, am I correct in assuming that we should accept the match only if the match is to the entire input line? You seem to be supplying your script with only the replacement text rather than the details of the IP and Port that are being changed, and your grep was looking for the next to the last entry above; but you latest message seems to be saying we should look for one of the first two???
I need to replace the line containing "STAGE_DB" with the line
"STAGE_DB $DB # database that contains the table being loaded ($workingDB)"
Here $DB is passed during the runtime.
How can I do this?
Thanks,
Kousikan (2 Replies)
Hi,
I'm struggling to write a script to do the following,
-will go through each line in the file
-in a specific character positions, changes
the value to a new value
-These character positions are fixed througout the file
-----------------------
e.g.: file1.sh will have the following 3... (4 Replies)
Hi All,
Does anyone know how to print 1H1A....... in peal script
print line ^1H1A....... if next line equal 5R0RECEIPT....
Thank for help:D
Cat st.txt
1H1A-IN-11-5410-0009420|1010047766|dsds|1|N|IN|IN|000000|1||N|<<<line match
5R0RECEIPT|
5R0RECEIPT|... (2 Replies)
Hi folks,
I've list of LDAP records in this format:
cat cmmac.export.tmp2
dn: deviceId=0a92746a54tbmd34b05758900131136a506,ou=devices,ou=customer,ou=nl,o=upc
cmmac: 00:13:11:36:a5:06
dn: deviceId=0a92746a62pbms4662299650015961cfa23,ou=devices,ou=customer,ou=nl,o=upc
cmmac:... (4 Replies)
Hi. I'd appreciate if I can get some direction in this issue to get me going.
Datafile1:
-About 4000 records, I have to update field#4 in selected records based on a match in the key field (Field#1).
-Field #1 is the key field (servername) . # of Fields may vary
# comment
server1 bbb ccc... (2 Replies)
Hi How Are you?
I am doing fine!
I need to go now?
I will see you tomorrow!
Basically I need to replace the entire line containing "doing" with a blank line:
I need to the following output:
Hi How Are you?
I need to go now?
I will see you tomorrow!
Thanks in advance.... (1 Reply)
not getting anywhere with this
an xml file contains multiple clients set up with same tags, different values.
I need to parse the file for client foo, and change the value of tag "64bit" from false to true.
cat clients.xml
<Client type"FIX">
<ClientName>foo</ClientName>... (3 Replies)
Im using the command below , but thats not the output that i want. it only prints the odd and even numbers.
awk '{if(NR%2){print $0 > "1"}else{print $0 > "2"}}'
Im hoping for something like this
file1:
Text hi this is just a test
text1 text2 text3 text4 text5 text6
Text hi... (2 Replies)
I am trying to combine lines with these conditions:
1. First line starts with text of "libname VALUE db2 datasrc" where VALUE can be any text.
2. If condition1 is met then continue to combine lines through a line that ends with a semicolon.
3. Ignore case when matching patterns and remove any... (5 Replies)
Hi,
I have some data like below:
John 254
Chris 254
Matt 123
Abe 123
Raj 487
Moh 487
How can i print it using awk to have:
254 John,Chris
123 Matt,Abe
487 Raj,Moh
Thanks. (4 Replies)