Recursive code line generator / text replacement utility? [on hold]
Anyone know of a nice utility (could be a simple online script) that does this? I suppose I could build one, but there must be a bunch out there already, I’m just not using the right search terms...
So let’s say I have a list of values, each value on a new line or comma separated, and I want to generate a line of code based on each…
So let’s say this is my line of code:
echo "<td>".$row[‘apple']."</td>";
And I want to make a similar line of code for each item on a list.
So I give it the line of code with where the items should go with %%%, such as:
echo "<td>".$row[‘%%%']."</td>";
And I provide a list, such as:
Apple
Pear
Grape
Peach
Kiwi
Banana
Or like this - Apple,Pear,Grape,Peach,Kiwi,Banana
And I want it to turn it into a block of code like this:
echo "<td>".$row[‘Apple']."</td>";
echo "<td>".$row[‘Pear']."</td>";
echo "<td>".$row[‘Grape']."</td>”;
etc.
Rather than just copying and pasting the line of code 20 times and then copying and pasting (or search and replace) the variable 20 times. Should be able to input the list and input the line of code, with %%% in the code where you want each list item inserted, and have it generate a block of code for you.
text replace generator
put on hold as off-topic by E_net4, Vega, TylerH, M-M, Paul Roub Jan 25 at 17:29
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – E_net4, Vega, TylerH, M-M, Paul Roub
If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
Anyone know of a nice utility (could be a simple online script) that does this? I suppose I could build one, but there must be a bunch out there already, I’m just not using the right search terms...
So let’s say I have a list of values, each value on a new line or comma separated, and I want to generate a line of code based on each…
So let’s say this is my line of code:
echo "<td>".$row[‘apple']."</td>";
And I want to make a similar line of code for each item on a list.
So I give it the line of code with where the items should go with %%%, such as:
echo "<td>".$row[‘%%%']."</td>";
And I provide a list, such as:
Apple
Pear
Grape
Peach
Kiwi
Banana
Or like this - Apple,Pear,Grape,Peach,Kiwi,Banana
And I want it to turn it into a block of code like this:
echo "<td>".$row[‘Apple']."</td>";
echo "<td>".$row[‘Pear']."</td>";
echo "<td>".$row[‘Grape']."</td>”;
etc.
Rather than just copying and pasting the line of code 20 times and then copying and pasting (or search and replace) the variable 20 times. Should be able to input the list and input the line of code, with %%% in the code where you want each list item inserted, and have it generate a block of code for you.
text replace generator
put on hold as off-topic by E_net4, Vega, TylerH, M-M, Paul Roub Jan 25 at 17:29
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – E_net4, Vega, TylerH, M-M, Paul Roub
If this question can be reworded to fit the rules in the help center, please edit the question.
Use sublime text editor
– Shaun Zyrille
Jan 21 at 16:55
@ShaunZyrille, do you know what the feature in sublime is called that does this?
– Ben in CA
Jan 23 at 19:56
Not really sure, but I guess you can make your own function in sublime in a selected area
– Shaun Zyrille
2 days ago
add a comment |
Anyone know of a nice utility (could be a simple online script) that does this? I suppose I could build one, but there must be a bunch out there already, I’m just not using the right search terms...
So let’s say I have a list of values, each value on a new line or comma separated, and I want to generate a line of code based on each…
So let’s say this is my line of code:
echo "<td>".$row[‘apple']."</td>";
And I want to make a similar line of code for each item on a list.
So I give it the line of code with where the items should go with %%%, such as:
echo "<td>".$row[‘%%%']."</td>";
And I provide a list, such as:
Apple
Pear
Grape
Peach
Kiwi
Banana
Or like this - Apple,Pear,Grape,Peach,Kiwi,Banana
And I want it to turn it into a block of code like this:
echo "<td>".$row[‘Apple']."</td>";
echo "<td>".$row[‘Pear']."</td>";
echo "<td>".$row[‘Grape']."</td>”;
etc.
Rather than just copying and pasting the line of code 20 times and then copying and pasting (or search and replace) the variable 20 times. Should be able to input the list and input the line of code, with %%% in the code where you want each list item inserted, and have it generate a block of code for you.
text replace generator
Anyone know of a nice utility (could be a simple online script) that does this? I suppose I could build one, but there must be a bunch out there already, I’m just not using the right search terms...
So let’s say I have a list of values, each value on a new line or comma separated, and I want to generate a line of code based on each…
So let’s say this is my line of code:
echo "<td>".$row[‘apple']."</td>";
And I want to make a similar line of code for each item on a list.
So I give it the line of code with where the items should go with %%%, such as:
echo "<td>".$row[‘%%%']."</td>";
And I provide a list, such as:
Apple
Pear
Grape
Peach
Kiwi
Banana
Or like this - Apple,Pear,Grape,Peach,Kiwi,Banana
And I want it to turn it into a block of code like this:
echo "<td>".$row[‘Apple']."</td>";
echo "<td>".$row[‘Pear']."</td>";
echo "<td>".$row[‘Grape']."</td>”;
etc.
Rather than just copying and pasting the line of code 20 times and then copying and pasting (or search and replace) the variable 20 times. Should be able to input the list and input the line of code, with %%% in the code where you want each list item inserted, and have it generate a block of code for you.
text replace generator
text replace generator
asked Jan 18 at 23:27
Ben in CABen in CA
128
128
put on hold as off-topic by E_net4, Vega, TylerH, M-M, Paul Roub Jan 25 at 17:29
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – E_net4, Vega, TylerH, M-M, Paul Roub
If this question can be reworded to fit the rules in the help center, please edit the question.
put on hold as off-topic by E_net4, Vega, TylerH, M-M, Paul Roub Jan 25 at 17:29
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – E_net4, Vega, TylerH, M-M, Paul Roub
If this question can be reworded to fit the rules in the help center, please edit the question.
Use sublime text editor
– Shaun Zyrille
Jan 21 at 16:55
@ShaunZyrille, do you know what the feature in sublime is called that does this?
– Ben in CA
Jan 23 at 19:56
Not really sure, but I guess you can make your own function in sublime in a selected area
– Shaun Zyrille
2 days ago
add a comment |
Use sublime text editor
– Shaun Zyrille
Jan 21 at 16:55
@ShaunZyrille, do you know what the feature in sublime is called that does this?
– Ben in CA
Jan 23 at 19:56
Not really sure, but I guess you can make your own function in sublime in a selected area
– Shaun Zyrille
2 days ago
Use sublime text editor
– Shaun Zyrille
Jan 21 at 16:55
Use sublime text editor
– Shaun Zyrille
Jan 21 at 16:55
@ShaunZyrille, do you know what the feature in sublime is called that does this?
– Ben in CA
Jan 23 at 19:56
@ShaunZyrille, do you know what the feature in sublime is called that does this?
– Ben in CA
Jan 23 at 19:56
Not really sure, but I guess you can make your own function in sublime in a selected area
– Shaun Zyrille
2 days ago
Not really sure, but I guess you can make your own function in sublime in a selected area
– Shaun Zyrille
2 days ago
add a comment |
1 Answer
1
active
oldest
votes
I couldn't find anything, so I built my own utility to do this.
Feel free to use it at http://synex.ca/codegen/index.php if you'd like.
And please up vote if you find this helpful.
And PLEASE don't complain if you don't like how I made it.
It's saved me a bunch of time already.
Hey, I'm interested in seeing what the result was, could you post a link to pastebin or github?
– Reez0
Jan 21 at 16:31
I don't have it on github or pastebin, etc. Right now this has been downvoted and has few views, if a bunch of people are interested I could publish it. Essentially I looped through a foreach statement with a replace command.
– Ben in CA
Jan 23 at 19:55
I've put this online for others to use now. See answer.
– Ben in CA
Jan 25 at 20:13
If anyone has a better name or terms/keywords to suggest what this should be called, let me know!
– Ben in CA
Jan 25 at 20:14
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I couldn't find anything, so I built my own utility to do this.
Feel free to use it at http://synex.ca/codegen/index.php if you'd like.
And please up vote if you find this helpful.
And PLEASE don't complain if you don't like how I made it.
It's saved me a bunch of time already.
Hey, I'm interested in seeing what the result was, could you post a link to pastebin or github?
– Reez0
Jan 21 at 16:31
I don't have it on github or pastebin, etc. Right now this has been downvoted and has few views, if a bunch of people are interested I could publish it. Essentially I looped through a foreach statement with a replace command.
– Ben in CA
Jan 23 at 19:55
I've put this online for others to use now. See answer.
– Ben in CA
Jan 25 at 20:13
If anyone has a better name or terms/keywords to suggest what this should be called, let me know!
– Ben in CA
Jan 25 at 20:14
add a comment |
I couldn't find anything, so I built my own utility to do this.
Feel free to use it at http://synex.ca/codegen/index.php if you'd like.
And please up vote if you find this helpful.
And PLEASE don't complain if you don't like how I made it.
It's saved me a bunch of time already.
Hey, I'm interested in seeing what the result was, could you post a link to pastebin or github?
– Reez0
Jan 21 at 16:31
I don't have it on github or pastebin, etc. Right now this has been downvoted and has few views, if a bunch of people are interested I could publish it. Essentially I looped through a foreach statement with a replace command.
– Ben in CA
Jan 23 at 19:55
I've put this online for others to use now. See answer.
– Ben in CA
Jan 25 at 20:13
If anyone has a better name or terms/keywords to suggest what this should be called, let me know!
– Ben in CA
Jan 25 at 20:14
add a comment |
I couldn't find anything, so I built my own utility to do this.
Feel free to use it at http://synex.ca/codegen/index.php if you'd like.
And please up vote if you find this helpful.
And PLEASE don't complain if you don't like how I made it.
It's saved me a bunch of time already.
I couldn't find anything, so I built my own utility to do this.
Feel free to use it at http://synex.ca/codegen/index.php if you'd like.
And please up vote if you find this helpful.
And PLEASE don't complain if you don't like how I made it.
It's saved me a bunch of time already.
edited Jan 25 at 20:11
answered Jan 21 at 16:20
Ben in CABen in CA
128
128
Hey, I'm interested in seeing what the result was, could you post a link to pastebin or github?
– Reez0
Jan 21 at 16:31
I don't have it on github or pastebin, etc. Right now this has been downvoted and has few views, if a bunch of people are interested I could publish it. Essentially I looped through a foreach statement with a replace command.
– Ben in CA
Jan 23 at 19:55
I've put this online for others to use now. See answer.
– Ben in CA
Jan 25 at 20:13
If anyone has a better name or terms/keywords to suggest what this should be called, let me know!
– Ben in CA
Jan 25 at 20:14
add a comment |
Hey, I'm interested in seeing what the result was, could you post a link to pastebin or github?
– Reez0
Jan 21 at 16:31
I don't have it on github or pastebin, etc. Right now this has been downvoted and has few views, if a bunch of people are interested I could publish it. Essentially I looped through a foreach statement with a replace command.
– Ben in CA
Jan 23 at 19:55
I've put this online for others to use now. See answer.
– Ben in CA
Jan 25 at 20:13
If anyone has a better name or terms/keywords to suggest what this should be called, let me know!
– Ben in CA
Jan 25 at 20:14
Hey, I'm interested in seeing what the result was, could you post a link to pastebin or github?
– Reez0
Jan 21 at 16:31
Hey, I'm interested in seeing what the result was, could you post a link to pastebin or github?
– Reez0
Jan 21 at 16:31
I don't have it on github or pastebin, etc. Right now this has been downvoted and has few views, if a bunch of people are interested I could publish it. Essentially I looped through a foreach statement with a replace command.
– Ben in CA
Jan 23 at 19:55
I don't have it on github or pastebin, etc. Right now this has been downvoted and has few views, if a bunch of people are interested I could publish it. Essentially I looped through a foreach statement with a replace command.
– Ben in CA
Jan 23 at 19:55
I've put this online for others to use now. See answer.
– Ben in CA
Jan 25 at 20:13
I've put this online for others to use now. See answer.
– Ben in CA
Jan 25 at 20:13
If anyone has a better name or terms/keywords to suggest what this should be called, let me know!
– Ben in CA
Jan 25 at 20:14
If anyone has a better name or terms/keywords to suggest what this should be called, let me know!
– Ben in CA
Jan 25 at 20:14
add a comment |
Use sublime text editor
– Shaun Zyrille
Jan 21 at 16:55
@ShaunZyrille, do you know what the feature in sublime is called that does this?
– Ben in CA
Jan 23 at 19:56
Not really sure, but I guess you can make your own function in sublime in a selected area
– Shaun Zyrille
2 days ago