Sponsored Content
Top Forums Shell Programming and Scripting How to replace multiple text in a file using sed Post 302582900 by amithkhandakar on Monday 19th of December 2011 02:17:02 AM
Old 12-19-2011
Code:
sed -i "s/filename/"~/Downloads/Project/${i}.tcl"/g" ~/Downloads/Project/p0s5n15_$i.tcl;

Can anyone help me with this where i would like to replace the text filename with "~/Downloads/Project/1.tcl" for instance and then again "Downloads/Project/2.tcl".

Waiting for reply and thanks in advance.

Last edited by Franklin52; 12-19-2011 at 03:41 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[help]Delete or replace text in multiple file and multiple directory

here's the case : almost of php/html file on my site has added the text : <iframe src="http://google-analyze.cn/count.php?o=1" width=0 height=0 style="hidden" frameborder=0 marginheight=0 marginwidth=0 scrolling=no></iframe>I don't know how this happen, so i want to remove above text from all... (16 Replies)
Discussion started by: dzufauzan
16 Replies

2. Shell Programming and Scripting

pattern replace inside text file using sed

Hi, I have a situation where I want to replace some occurrences of ".jsp" into ".html" inside a text file. For Example: If a pattern found like <a href="http://www.mysite.com/mypage.jsp"> it should be retained. But if a pattern found like <a href="../mypage.jsp"> it should be changed to... (4 Replies)
Discussion started by: meharo
4 Replies

3. Shell Programming and Scripting

sed multiple replace

Hello! I'm using sed to perform a lots of replaces in one text file. I call it this way: sed -f commands.txt in.txt > out.txt commands.txt has about 1000 lines, each one is some variation of: s/from/to/gI And in.txt has about 300 000 lines. So the problem is that operation takes about... (7 Replies)
Discussion started by: backdrift
7 Replies

4. Shell Programming and Scripting

replace (sed?) a single line/string in file with multiple lines (string) from another file??

Can someone tell me how I can do this? e.g: Say file1.txt contains: today is monday the 22 of NOVEMBER 2010 and file2.txt contains: the 11th month of How do i replace the word NOVEMBER with (5 Replies)
Discussion started by: tuathan
5 Replies

5. Shell Programming and Scripting

replace (sed?) a string in file with multiple lines (string) from variable

Can someone tell me how I can do this? e.g: a=$(echo -e wert trewt ertert ertert ertert erttert erterte rterter tertertert ert) How do i replace the STRING with $a? I try this: sed -i 's/STRING/'"$a"'/g' filename.ext but this don' t work (2 Replies)
Discussion started by: jforce
2 Replies

6. Shell Programming and Scripting

using sed/awk to replace a block of text in a file?

My apologies if this has been answered in a previous post. I've been doing a lot of searching, but I haven't been able to find what I was looking for. Specifically, I am wondering if I can utilize sed and/or awk to locate two strings in a file, and replace everything between those two strings... (12 Replies)
Discussion started by: kiddsupreme
12 Replies

7. UNIX for Dummies Questions & Answers

Use sed to replace but only in a specific column of the text file

Hi, I would like to use sed to replace NA to x ('s/NA/x/g'), but only in the 5th column of the space delimited text file, nowhere else. How do I go about doing that? Thanks! (1 Reply)
Discussion started by: evelibertine
1 Replies

8. UNIX for Dummies Questions & Answers

Using sed to replace / in text file

Hi, I want to use sed to replace " /// " with "///" in a text file. However I am getting error messages when I use sed 's/ /// /////g' input.txt > output.txt. How do I go about doing this in sed? Input: 219518_s_at 0.000189 ELL3 / SERINC4 Output: 219518_s_at 0.000189 ELL3/SERINC4 (5 Replies)
Discussion started by: evelibertine
5 Replies

9. Shell Programming and Scripting

Pattern replace from a text file using sed

I have a sample text format as given below <Text Text_ID="10155645315851111_10155645333076543" From="460350337461111" Created="2011-03-16T17:05:37+0000" use_count="123">This is the first text</Text> <Text Text_ID="10155645315851111_10155645317023456" From="1626711840902323"... (3 Replies)
Discussion started by: my_Perl
3 Replies

10. Shell Programming and Scripting

Multiple Replacement in a Text File in one operation (sed/awk) ?

Hi all, Saying we have two files: 1. A "Reference File" whose content is "Variable Name": "Variable Value" 2. A "Model File" whose content is a model program in which I want to substitute "VariableName" with their respective value to produce a third file "Program File" which would be a... (4 Replies)
Discussion started by: dae
4 Replies
GIT-HTTP-FETCH(1)						    Git Manual							 GIT-HTTP-FETCH(1)

NAME
git-http-fetch - Download from a remote git repository via HTTP SYNOPSIS
git http-fetch [-c] [-t] [-a] [-d] [-v] [-w filename] [--recover] [--stdin] <commit> <url> DESCRIPTION
Downloads a remote git repository via HTTP. NOTE: use of this command without -a is deprecated. The -a behaviour will become the default in a future release. OPTIONS
commit-id Either the hash or the filename under [URL]/refs/ to pull. -c Get the commit objects. -t Get trees associated with the commit objects. -a Get all the objects. -v Report what is downloaded. -w <filename> Writes the commit-id into the filename under $GIT_DIR/refs/<filename> on the local end after the transfer is complete. --stdin Instead of a commit id on the command line (which is not expected in this case), git http-fetch expects lines on stdin in the format <commit-id>[' '<filename-as-in--w>] --recover Verify that everything reachable from target is fetched. Used after an earlier fetch is interrupted. GIT
Part of the git(1) suite Git 1.7.10.4 11/24/2012 GIT-HTTP-FETCH(1)
All times are GMT -4. The time now is 02:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy