10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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)
Discussion started by: Pradhikshan
9 Replies
2. Shell Programming and Scripting
I need to replace dashes (i.e. -) if present from positions 351-357 with zero (i.e. 0), I also need to replace dash (i.e “-“) if present between position 024-043 with zero (i.e. 0) & I replace " " (i.e. 2 space characters) if present at position 381-382 with "04". Total length of record is 413.... (11 Replies)
Discussion started by: lancesunny
11 Replies
3. Shell Programming and Scripting
How to replace the position specific values in the file..
i searched a lot the forums but i couldn't able to do...
i have file like below
576666666666666666666666666 7878 897987 121 0asdas Y12
5900fbb 777 09JJJ 78798347892374 234234234364 234232898
89HJHIHIGIUG989902743748327khjkhkjlh... (6 Replies)
Discussion started by: greenworld123
6 Replies
4. Shell Programming and Scripting
Hi All,
I have a file that I would like to search for data and replace other data by record position number:
Example search..
search for "CLARK KENT" and replace Amt data "000025" with "000155"???
I'm able to search and replace unique data but, came to a stump when wanting to replace data... (11 Replies)
Discussion started by: macastor
11 Replies
5. Shell Programming and Scripting
Hello everyone this is my first post of many to come :)
I am writing a script and in this script at one point i need to replace a character in a particular position in a string for example:
in the string "mystery" i would need to replace the 3rd position to an "r" so the string becomes... (3 Replies)
Discussion started by: snipaa
3 Replies
6. Shell Programming and Scripting
I'm drawing a blank on how to use sed to replace selectively based on position in the string (vs nth occurence):
hello.|there.|how.|are.|you.|
I want the period removed in the 3rd item (as defined by the pipe delimiter) if a period is present. So the result in this case would be:
... (2 Replies)
Discussion started by: tiggyboo
2 Replies
7. UNIX for Dummies Questions & Answers
Trying to use sed - but having no luck.
I have a text file - I want to replace whatever character is in position 106, 157 and 237 w/ the string "xxx". Want this change for all lines w/in that text file.
I'm open to using awk or whatever command would be best for replacing characters based... (5 Replies)
Discussion started by: svn
5 Replies
8. UNIX for Dummies Questions & Answers
I need to replace the character on 6th position. If this character is 1 I have to repleace it with A, if it is 2 than I have to replace it with B. If it is not 1 or 2 I should not repleace it.
input:
abcd defg
abcd 1efg
mnop weac
rstu 2bcd
i need:
abcd defg
abcd Aefg
mnop weac
rstu... (2 Replies)
Discussion started by: necroman08
2 Replies
9. UNIX for Dummies Questions & Answers
i have this contents:
H,0100, 4022,FISHER810,6109566,,,,,0,562032,
D,0100, 4022,FISHER810,6109566,,1,,,0,562032
if i see 0 at position 40, i want to replace with R. (7 Replies)
Discussion started by: tjmannonline
7 Replies
10. Shell Programming and Scripting
Hi all,
I need your help.
For example I have string in file.txt:
-x -a /tmp/dbarchive_NSS_20081204 -f 900 -l 1 2008/12/04 2008/12/04
So, I need to replace symbols from (for e.g.) position 26 till 33 with symbols which I have in file replace.txt
And I have no idea how to do it.
If... (1 Reply)
Discussion started by: nypreH
1 Replies