Find certain string in .php file and replace [on hold]

Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
0
down vote
favorite
So IâÂÂm pretty new to using Linux etc, and I was wondering if thereâÂÂs any possibility someone could tell me how I can write the following ( I will be pretty clear, so you wonâÂÂt have to type like âÂÂfile1â or sth like that ):
So I want to be able to run a program that just searches for the string in my php file, and replaces it with the string I type. ( the string that needs to be replaced is everytime on the same place in the php file and is everytime something different )
I have multiple php files where this needs to happen, but every different php file needs the same string replaced by the thing I type.
All this just makes it 10 times easier for me, because otherwise I need to open every php file one by one and change that certain string.
If you need any more info about it. Or if I wasnâÂÂt clear for certain things, let me know!
Thanks for reading /( maybe answering?) this
linux sed php replace
put on hold as unclear what you're asking by Jeff Schaller, G-Man, SivaPrasath, schily, Jesse_b 11 hours ago
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, itâÂÂs hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |Â
up vote
0
down vote
favorite
So IâÂÂm pretty new to using Linux etc, and I was wondering if thereâÂÂs any possibility someone could tell me how I can write the following ( I will be pretty clear, so you wonâÂÂt have to type like âÂÂfile1â or sth like that ):
So I want to be able to run a program that just searches for the string in my php file, and replaces it with the string I type. ( the string that needs to be replaced is everytime on the same place in the php file and is everytime something different )
I have multiple php files where this needs to happen, but every different php file needs the same string replaced by the thing I type.
All this just makes it 10 times easier for me, because otherwise I need to open every php file one by one and change that certain string.
If you need any more info about it. Or if I wasnâÂÂt clear for certain things, let me know!
Thanks for reading /( maybe answering?) this
linux sed php replace
put on hold as unclear what you're asking by Jeff Schaller, G-Man, SivaPrasath, schily, Jesse_b 11 hours ago
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, itâÂÂs hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
1
adding few sample files(2-5 lines each) and expected output will go a long way in improving the question.. you mention everytime something is different, how to do you expect an answer if we do not know the nature of it? are you replacing entire line? particular word that occurs after something fixed? and so on.. that said, unix.stackexchange.com/questions/112023/⦠should get you started with sed and perhaps even answer your question fully
â Sundeep
yesterday
ThereâÂÂs a certain line in my php file that says: $spend_x = âÂÂI_Want_ToReplace_Thisâ , and I want to replace that with something I type in a txt file, so everytime I type something in the Txt file, it automatically changes in every php file
â Edouard Goddeeris
yesterday
1
@EdouardGoddeeris Add that information to your question with parts of the file for and example and the expected output. You're more likely to get the help you need that way.
â Nasir Riley
yesterday
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
So IâÂÂm pretty new to using Linux etc, and I was wondering if thereâÂÂs any possibility someone could tell me how I can write the following ( I will be pretty clear, so you wonâÂÂt have to type like âÂÂfile1â or sth like that ):
So I want to be able to run a program that just searches for the string in my php file, and replaces it with the string I type. ( the string that needs to be replaced is everytime on the same place in the php file and is everytime something different )
I have multiple php files where this needs to happen, but every different php file needs the same string replaced by the thing I type.
All this just makes it 10 times easier for me, because otherwise I need to open every php file one by one and change that certain string.
If you need any more info about it. Or if I wasnâÂÂt clear for certain things, let me know!
Thanks for reading /( maybe answering?) this
linux sed php replace
So IâÂÂm pretty new to using Linux etc, and I was wondering if thereâÂÂs any possibility someone could tell me how I can write the following ( I will be pretty clear, so you wonâÂÂt have to type like âÂÂfile1â or sth like that ):
So I want to be able to run a program that just searches for the string in my php file, and replaces it with the string I type. ( the string that needs to be replaced is everytime on the same place in the php file and is everytime something different )
I have multiple php files where this needs to happen, but every different php file needs the same string replaced by the thing I type.
All this just makes it 10 times easier for me, because otherwise I need to open every php file one by one and change that certain string.
If you need any more info about it. Or if I wasnâÂÂt clear for certain things, let me know!
Thanks for reading /( maybe answering?) this
linux sed php replace
asked yesterday
Edouard Goddeeris
1
1
put on hold as unclear what you're asking by Jeff Schaller, G-Man, SivaPrasath, schily, Jesse_b 11 hours ago
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, itâÂÂs hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
put on hold as unclear what you're asking by Jeff Schaller, G-Man, SivaPrasath, schily, Jesse_b 11 hours ago
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, itâÂÂs hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
1
adding few sample files(2-5 lines each) and expected output will go a long way in improving the question.. you mention everytime something is different, how to do you expect an answer if we do not know the nature of it? are you replacing entire line? particular word that occurs after something fixed? and so on.. that said, unix.stackexchange.com/questions/112023/⦠should get you started with sed and perhaps even answer your question fully
â Sundeep
yesterday
ThereâÂÂs a certain line in my php file that says: $spend_x = âÂÂI_Want_ToReplace_Thisâ , and I want to replace that with something I type in a txt file, so everytime I type something in the Txt file, it automatically changes in every php file
â Edouard Goddeeris
yesterday
1
@EdouardGoddeeris Add that information to your question with parts of the file for and example and the expected output. You're more likely to get the help you need that way.
â Nasir Riley
yesterday
add a comment |Â
1
adding few sample files(2-5 lines each) and expected output will go a long way in improving the question.. you mention everytime something is different, how to do you expect an answer if we do not know the nature of it? are you replacing entire line? particular word that occurs after something fixed? and so on.. that said, unix.stackexchange.com/questions/112023/⦠should get you started with sed and perhaps even answer your question fully
â Sundeep
yesterday
ThereâÂÂs a certain line in my php file that says: $spend_x = âÂÂI_Want_ToReplace_Thisâ , and I want to replace that with something I type in a txt file, so everytime I type something in the Txt file, it automatically changes in every php file
â Edouard Goddeeris
yesterday
1
@EdouardGoddeeris Add that information to your question with parts of the file for and example and the expected output. You're more likely to get the help you need that way.
â Nasir Riley
yesterday
1
1
adding few sample files(2-5 lines each) and expected output will go a long way in improving the question.. you mention everytime something is different, how to do you expect an answer if we do not know the nature of it? are you replacing entire line? particular word that occurs after something fixed? and so on.. that said, unix.stackexchange.com/questions/112023/⦠should get you started with sed and perhaps even answer your question fully
â Sundeep
yesterday
adding few sample files(2-5 lines each) and expected output will go a long way in improving the question.. you mention everytime something is different, how to do you expect an answer if we do not know the nature of it? are you replacing entire line? particular word that occurs after something fixed? and so on.. that said, unix.stackexchange.com/questions/112023/⦠should get you started with sed and perhaps even answer your question fully
â Sundeep
yesterday
ThereâÂÂs a certain line in my php file that says: $spend_x = âÂÂI_Want_ToReplace_Thisâ , and I want to replace that with something I type in a txt file, so everytime I type something in the Txt file, it automatically changes in every php file
â Edouard Goddeeris
yesterday
ThereâÂÂs a certain line in my php file that says: $spend_x = âÂÂI_Want_ToReplace_Thisâ , and I want to replace that with something I type in a txt file, so everytime I type something in the Txt file, it automatically changes in every php file
â Edouard Goddeeris
yesterday
1
1
@EdouardGoddeeris Add that information to your question with parts of the file for and example and the expected output. You're more likely to get the help you need that way.
â Nasir Riley
yesterday
@EdouardGoddeeris Add that information to your question with parts of the file for and example and the expected output. You're more likely to get the help you need that way.
â Nasir Riley
yesterday
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
1
adding few sample files(2-5 lines each) and expected output will go a long way in improving the question.. you mention everytime something is different, how to do you expect an answer if we do not know the nature of it? are you replacing entire line? particular word that occurs after something fixed? and so on.. that said, unix.stackexchange.com/questions/112023/⦠should get you started with sed and perhaps even answer your question fully
â Sundeep
yesterday
ThereâÂÂs a certain line in my php file that says: $spend_x = âÂÂI_Want_ToReplace_Thisâ , and I want to replace that with something I type in a txt file, so everytime I type something in the Txt file, it automatically changes in every php file
â Edouard Goddeeris
yesterday
1
@EdouardGoddeeris Add that information to your question with parts of the file for and example and the expected output. You're more likely to get the help you need that way.
â Nasir Riley
yesterday