10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I want to insert "Text" in each file as a place where I mentioned below "Insert Text Here". These files are something like news of newspaper. Generally, newspaper headlines contain one or two lines.
I don't know how it can be identified whether Text is inserted after first line or second line.
... (10 Replies)
Discussion started by: imranrasheedamu
10 Replies
2. Shell Programming and Scripting
Hello, I am trying to insert a section of text between lines in another text file.
The new lines to be inserted are:
abcd.efgh.zzzz=blah
abcd.efgh.xxxx=blah
Where N = 0 to 2
Original File:
abcd.efgh.wwxx=aaaaa
abcd.efgh.yyzz=bbbbb
abcd.efgh.wwxx=aaaaa
abcd.efgh.yyzz=bbbbb... (3 Replies)
Discussion started by: tsu3000
3 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I am trying to organize a badly constructed web server. Basically every file is in public_html which is horrendous. There's about 50 images and 20 html files (not counting the css files and pdf docs).
I am trying to update each .html file using sed based on:
Where string contains *.jpg... (9 Replies)
Discussion started by: enginama
9 Replies
4. Shell Programming and Scripting
I need to read a text file and insert a string every n lines, but also have the line counter restart when I come across a header string.
Line repeating working every 3 lines using code:
sed '0~3 s/$/\nINSERT/g' < INPUT/PATH/FILE_NAME.txt > OUTPUT/PATH/FILE_NAME.txt
I cannot seem to find... (1 Reply)
Discussion started by: Skonectthedots
1 Replies
5. Shell Programming and Scripting
Hi,
I have a text file with one line having few words separated by space and I need to insert another word on "n"th column/field so that previous word should shift right (to n+1st column). how can I do that?
It seems we can do using awk but unable to figure out.
Please advise, thanks!
... (11 Replies)
Discussion started by: magnus29
11 Replies
6. Shell Programming and Scripting
I want to put a particular text, say, the hash '#' before each of the first n lines of a file.
How can I do that? (4 Replies)
Discussion started by: hbar
4 Replies
7. Shell Programming and Scripting
how can i insert a string sush as "###" instead of blank lines in a file?
i try this code but it doesn't work!
awk 'NF<1 {$1=="###" ; print$0}' in_file > out_file (13 Replies)
Discussion started by: oreka18
13 Replies
8. Shell Programming and Scripting
Hi
I am trying to insert a block of text 2 lines above a pattern match using sed
eg
#Start of file entry
{
}
#End of file entry
new bit of text has to be put in just above the } eg
#Start of file entry
{
New bit of text
}
#End of file entry (7 Replies)
Discussion started by: eeisken
7 Replies
9. Shell Programming and Scripting
Hi All,
In continuation of my previous thread 'Add text at the end of line conditionally', I need to further modfiy the file after adding text at the end of the line. Now, I need to add a fixed charater string at alternate lines starting from first line using awk or sed.My file is now as below:... (10 Replies)
Discussion started by: angshuman
10 Replies
10. Shell Programming and Scripting
Hi, I am new to Unix and this is my first post on this forum. I am trying to convert a file into an xml. In my input I want to search for any line that starts with a 'F' and make it a tag in the xml.
See below for the input and output.
Input :
<Payment>
<REFERENCE>78</REFERENCE>
F123 : ... (7 Replies)
Discussion started by: akashgov
7 Replies