[Solved] Editing the alphabet's based on position information
I do have a file of the following format
file 1
like this above file. file 1 has 1000's of lines. I would like to edit this file1 using the information from file2 (see below), by replacing the 4th alphabet or alphabet at the position 4 C with T; 10th position alphabet A to C ......61th position alphabet G to A and 66th position alphabet A to C.
file 2
I am expecting the output file, file 3 with the edits.
Please let me know the best way edit this file1 and create the new file 3 using awk or sed or perl
No it doesn't have a length of 66. In the second file, file2 shows the position on file1 where the edits has to be done. The actual file have 1000's of letters. Hope this helps
Your sample output file does by no means fit the edits defined in file 2 applied to file1, e.g. line 2 pos 10 should have become a C; and where does line 2 pos 29 A come from?
Please post representative samples, and your solution attempts so far.
Counts don't go for each line. It starts from position 1 and goes continuously to the end of the file. It is not counted separately for each line. Hope this makes it clearer. I tried to put in it all in a hash using perl but was not successful in getting the output
Hi,
I have a file with multiple lines(fixed width dat file). I want to search for '02' in the positions 45-46 and if available, in that lines, I need to replace value in position 359 with blank. As I am new to unix, I am not able to figure out how to do this. Can you please help me to achieve... (9 Replies)
Dear Experts,
I need your help here. I have lot of teradata DDL's as follows, i want to extract field names , field attributes and NOT NULL information from DDL.Could you please help here.
Sample DDL:
CREATE MULTISET TABLE APS_CALL_IN_PICKUP_CANCELED ,NO FALLBACK ,
NO BEFORE... (2 Replies)
I need to grab information from the output of the ps command.
For each line of ps output that contains _progres -b I need to get the word that follows -p. The "-p" can be anywhere after "_progres -b".
Using grep to select the correct lines is no problem (e.g. ps -ef|grep "_progres \-b|grep -v... (3 Replies)
Hi,
I have one script in my cronjob, which is fetching file from a ftp site and making a copy with today's date and time. This is a new setup. There was a instance when test_bill.txt was not present on ftp.xxxx_xxxx.com and when this job ran and did not fetched file, still it send mail of... (5 Replies)
Hi All,
I am writing a script where the first 5 parameters are mandatory but the script should be able to handle a maximum of 9 parameters (with the remainig 4 optional)
I would like to load all parameters from 5th parameter positioninto an array.
the piece of code I am writing for this:... (0 Replies)
Hi Guys!
Could anyone help me with?..
I have a line which says
BCVGF%6$#900 .....How can we know which position is for % or say $ by command or script?There is any way to get a prompt by any script?
Thanks a lot (6 Replies)
I need to process 4 files having name pattern as followis:-
1) Each file starts with = ABCJmdmfbsjop letters + 7 Digit Number _mm-dd-yyyy-hh-mm-ss-3 Digit Number.data
where ABCJmdmfbsjop :- is alphabet. Each file starts with this ABCJmdmfbsjop alphabet.
7 Digit Number :- Numeric 7 digits.
__:-... (1 Reply)
Hi,
I'm trying to download a compatible Oracle Client software for a HP-UX machine. I'd like to know if ...
1) HP-UX is 32 bit or 64 bit?
2) Processor type - Itanium or regular?
when I execute uname -a I get
HP-UX B.11.11 U 9000/800 728684161 unlimited-user license
Based on the... (7 Replies)