I would like to have experts help on below action.
I have text files in which page nubmers exists in form like
and so on there is other text too. I would like to know is it possible to check the last occurance of Page numer and replace this value as below
Similarly I have to replace some text with blank spaces.
i.e the text is like ***Disclaimer Statement**** . Can I replace this with spaces. This text is Fixed and always occured in the end of every text file.
Regards,
Hassan
---------- Post updated at 02:53 PM ---------- Previous update was at 11:38 AM ----------
Further to update that I have tried to replace the text
with blank spaces, but the sign * not replacing only the Alphabets were replaced I sued below code.
Similarly received error
while replacing
thru above code
Kindly advice.
Regards,
Hassan
Last edited by radoulov; 02-10-2011 at 05:19 AM..
Reason: Code tags, please!
I have tried but the page no reformatting is not working. I have uploaded the sample file names "test.txt". Kindly note that the contents are purely dummy.
Similarly the second option's approach has changed. Now I want to replace all the text with blank lines/spaces after pharase
Actually the text might be changed after time to time after this pharse, so I need to check how many lines are there having text and remove all lines with blank lines. In attachment you can view that there is 13 lines after this pharse that contains any text I want to replace these 13 lines (or any number of lines if text changes) with blank lines and the reamining blank lines after and before that text must be same.
I am trying to use awk skip each line with a ## or # and check each line after for STB= and if that value in greater than or = to 0.8, then at the end of line the text "STRAND BIAS" is written in else "GOOD".
So in the file of 4 entries attached.
awk tried:
awk NR > "##"' "#" -F"STB="... (6 Replies)
Have multiple files with the same format and certain text is the same. Have specific text to search for and then need to replace the next line. Can search on the text DEVICE and multiple lines will be found. The line after each DEVICE line has {. Want to replace the line { with {-someadditiontext.... (2 Replies)
how to add a text ( surya) at the beginning of a text files (so many) in folder
text file:
111111
555555
666666
result:
surya
111111
555555
666666 (3 Replies)
Here's the nonfunctional code I have so far
#!/bin/bash
searchFor=(`cat filea.txt` )
replaceWith=(`cat fileb.txt`)
myMax=${#searchFor}
myCounter=1
while ;
do sed -i 's/${$searchFor}/${$replaceWith}/g'
done
The goal is to use each line in filea.txt as a search term, and each line... (2 Replies)
i am editing a big log file with the following pattern:
Date: xxxx Updated: name
Some log file text here
Date: eee Updated: ny
Some log file text here
Basically i want to remove all the text in a line before the "Updated" pattern. I sill want to print the other... (4 Replies)
I have 100+ python files in a single directory. I need to replace a specific path occurrence with a variable name.
Following are the find and the replace strings:
Findstring--"projects\\Debugger\\debugger_dp8051_01\\debugger_dp8051_01.cywrk"
Replacestring--self.projpath
I tried... (5 Replies)
I have an html file that looks like this (this is just a part of the html file):
<td colspan="3" rowspan="1" style="text-align: center; background-color: rgb(<!-- IDENTIFIER1 -->51, 255, 51);"><small><!-- IDENTIFIER2 -->UP</small></td>
This is to automatically update the status of the... (4 Replies)
Dear friends please help,
I have a large data file with few hundred lines. A small example is shown below:
datafile is a file with few hundred lines with the third column has many different character stings:
test 100 abc
test 134 bcd
test 356 cdf
test 831 dfg
test 720 fgh
I need to... (6 Replies)
Is there a way that I can make the following work with using variables?
perl -pi -e 's#blah#hrm#ig' replacetext
but like this
var=blah
perl -pi -e 's#$var#hrm#ig' replacetext (3 Replies)