![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| replace a word in a file only first 10 occurances | nawazkhan77 | Shell Programming and Scripting | 4 | 11-12-2008 05:48 AM |
| how do I replace a word in a file using DOS commands?? | sabithareddym | Windows & DOS: Issues & Discussions | 1 | 05-22-2008 12:17 AM |
| Replace word in a file | sasiharitha | UNIX for Dummies Questions & Answers | 3 | 12-05-2007 01:11 AM |
| replace word in a file | ust | Shell Programming and Scripting | 5 | 11-30-2007 08:03 PM |
| How to replace a word with a series of words in a file | brap45 | Shell Programming and Scripting | 2 | 02-21-2006 02:33 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi,
this belongs a little to my other post [1] but only at the starting point. With Code:
find -name "*.htm*" Code:
./1999/01/file1.html ./1999/01/file2.html ./1999/02/file1.html ./2000/04/file1.html ./2000/04/file2.html ./2000/04/file3.html ./2000/file1.html ./2000/file2.html ./file1.html ./file2.html ./file3.html Code:
./1999 | 1999| 1999 | author | mail/01 | 01 | 01 | author | mail/<title> | file1.html | file1.html | author | mail ./1999 | 1999| 1999 | author | mail/ 01 | 01 | 01 | author | mail/<title>| file2.html | file2.html | author | mail ./2000 | 2000| 2000 | author | mail/<title> | file1.html | file1.html | author | mail ./2000 | 2000| 2000 | author | mail/<title> | file2.html | file2.html | author | mail ./<title> | file1.html | file1.html | author | mail ./<title> | file2.html | file2.html | author | mail I fetch the content with another script: Code:
for i in `find -name "*.htm*"`
do
awk -F'<title>' -v RS='</title>' 'RT{print $NF}' $i
done
Sitetitle 1 Sitetitle 2 Sitetitle 3 ... So, now i have two files who have the same number of lines. How i could replace <title> with Sitetitle 1 ? It this the right way with two files or its better to fetch the content of <title>-tag in the first script? Thanks in advance Stefano [1] Insert Tabs / Indent text Last edited by Tonda; 02-26-2009 at 08:24 AM.. Reason: Fix a typo in title |
![]() |
| Bookmarks |
| Tags |
| awk, replace, two files |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|