Replace character string in txt file using input file(S)
Hi
I have a large txt file on my AIX server and I need to replace some text using two other files. So filename1 has about 500 lines similar to:
I have the string I want to change in string2 and the new stringname in string3. Does anyone know a way of doing this? I have awk,sed,perl,vi etc.
So it will be
Any help much appreciated as usual!
G
---------- Post updated at 11:48 AM ---------- Previous update was at 10:21 AM ----------
Here's a section of the file and also the two string files:
Plus lots of other coding...
file string1 contains all of the existing MEMNAME
file string2 contains what I want the new ones to be (Basically all lower case)
I can't do a global change because the MEMNAME exists in other parts of the file in Upper Case which is valid.
Cheers
Moderator's Comments:
This account has been placed in read-only mode for a day due to repeated refusal to properly format posts with CODE tags.
Last edited by Don Cragun; 02-05-2016 at 11:58 AM..
Reason: Add CODE and ICODE tags.
---------- Post updated at 15:30 ---------- Previous update was at 15:20 ----------
Not sure how that is to be interpreted: Will MEMNAME be the key for the replacement, or will it be MEMNAME="PREBK001"? If MEMNAME with upper case is valid in other spots, how is the one to be replaced being identified?
Hi I need help with writing a script to change a string in a file.
The script needs to read an input list (list.txt) file line by line searching for that string in a text.file. Once the string is found the last few words in the string should be replaced.
eg list.txt will contain
hello my... (6 Replies)
so...
Lets assume I have a text file.
The text file contains multiple "#" symbols.
I want to replace all thos "#"s with a STRING using DOS/Batch
I want to add a certain TEXT to the end of each line.
How can I do this WITHOUT aid of sed, grep or anything linux related ? (1 Reply)
Hi friends,
I am pretty new to shell scripting, please help me in this Scenario.
for example, If I have one file called input.txt
once I run the script,
1.It has to delete the old input.txt and create the new input.txt (if old input.txt is not there, no offence, just it has to create a... (2 Replies)
Hi i am having XML file with many number of lines,I need to replace between two strings with .txt file using awk.
For ex
<PersonInfoShipTo ------------------------------ />
My requirement is to replace the content between
<PersonInfoShipTo ------------------------------ />
help me.
Thanks... (9 Replies)
Hello everyone,
ive been trying to replace a string "kw01" in an xml file with the contents of a txt file having multiple lines. im a unix newbie and all the sed combinations i tried resulted to being garbled. Below is the contents of the txt file:
RAISEDATTIME
--------------------... (13 Replies)
Can someone tell me how I can do this?
e.g:
Say file1.txt contains:
today is monday
the 22 of
NOVEMBER
2010
and file2.txt contains:
the
11th
month
of
How do i replace the word NOVEMBER with (5 Replies)
Hi there,
my ksh script collects a procstack trace for a particular pid and then greps it by a transaction id to find out the pthread ID:
---------- tid# 1876087 (pthread ID: 4466) ----------
So the pthread ID I want is 4466 in this case, and it is assighed to the variable $pthread.... (4 Replies)
Can someone help me to write a script / command to read in a file, character by character, replace any unknown ASCII characters with space. then write out the file to a new filename/
Thanks! (1 Reply)
I am facing one problem, can any one please suggest me the command for the same in unix. I am using Ksh.
I have a large file with the data that looks like below.
"ROTO2-2007f","_US01","9/15/2007","9/21/2007",346492,"NICK, LCD WATCH"97,1,"NAPOLITJ ","BERGER,M Z & CO INC",0.01,
... (2 Replies)
I need to take the totals from my script and input them into a excel spreadsheet. Right now, I just copy and paste. Is there an easier way?
3906
is the total jobs in ABEND state
4005
is the total jobs in SUCC state
1050
is the total jobs in HOLD state (1 Reply)