07-05-2012
automate editing of a template
Given two files:
File1 - source data
abc
def
ghi
File 2 - a template to be edited with data from File 1This is a line with a @tag@ of some item A
This is a line with a @tag@ of some item B
This is a line with a @tag@ of some item C
What I want to do is substitute @tag@ with a value from File 1, so the resulting file 2 wold beThis is a line with a abc of some item A
This is a line with a dev of some item B
This is a line with a ghi of some item C
I'm comfortable with simple to moderate shell scripting. Have lots of scripts that use sed to make global change of simple values from a single, known input value, but this one has me stumped. In the above, I'm not wedded to the idea of a single @tag@, - have no problem with using @tag1@, @tag2@, etc, if it simplifies things.
Thanks for any pointers.
6 More Discussions You Might Find Interesting
1. Programming
Hi, i have class template,
1)can i override the copy constructor
2)can we have virtual function in class template
if not plz tel why? I tried , compile error comes for me...
Thanks
Sarwan (0 Replies)
Discussion started by: sarwan
0 Replies
2. Programming
Hi all,
Need your help. I am doing a simple template program , getting some error ... here is the code
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include<iostream>
#include<string>
#include <sstream>
using namespace std;
class Base_class
{
public:
Base_class(){... (1 Reply)
Discussion started by: amartya_sock
1 Replies
3. Shell Programming and Scripting
hi experts,
i'm trying to do this:
file1 is a template. might have kinds of 'funny' characters.
sample:
<body>
<form>
<p><input type="text" name="abc"/></p>
<p><my_content></p>
</form>
</body>
file2 is a file that contains lots of text. this might be very big. might have... (2 Replies)
Discussion started by: xjohnu
2 Replies
4. Programming
I get some compiling errors about template instantiation :wall: , but I can't find where the syntax errors happens. Can some help me?
template<typename Type> class SingleList;
template<typename Type> class SingleListNode{
private:
friend class SingleList<Type>;
SingleListNode() :... (1 Reply)
Discussion started by: 915086731
1 Replies
5. Programming
Hello Again,
I am just wanted to know if we can call the Template using "require_once" at PHP?
Any views around happy to discuss.
Thanks in Advance (2 Replies)
Discussion started by: AimyThomas
2 Replies
6. Shell Programming and Scripting
Dear Guru's
I'm using Putty and want to edit a file. I know we generally use vi editor to do it. As I'm not good in using vi editor, I want to convert the vi into something like text pad. Is there any option in Putty to do the same ? Thanks for your response.
Srini (6 Replies)
Discussion started by: thummi9090
6 Replies
LEARN ABOUT DEBIAN
sketch
SKETCH(1) User Commands SKETCH(1)
NAME
sketch - Produce 3D line drawings from scene description language
DESCRIPTION
sketch [options] file1 [-D tag] [-U tag] file2...
-h
Print a summary of options to stderr
-v
Print version info to standard output
-d
Debug parser (for developers)
-b
Use BSP rather than Painters algorithm for hidden surface removal
-T[u|e][p[P|T]]
Produce a complete LaTeX document
u
U.S. paper size (8.5 x 11 inches) (default)
e
European A4 paper size (297 x 210 mm)
p
Print document template to stdout
P
Print PSTricks version of doc template (default)
T
Print TikZ version of doc template
-t templatefile
Load user document template (any text file with escape %SKETCH_OUTPUT%)
-o outfile
Put output in outfile (default is stdout)
-D tag
Define given tag
-U tag
Undefine given tag
SEE ALSO
The full documentation for sketch is maintained as a Texinfo manual. If the info and sketch programs are properly installed at your site,
the command
info sketch
should give you access to the complete manual.
AUTHOR
This manual page was written by David Bremner bremner@unb.ca for the Debian(TM) system (but may be used by others). Permission is granted
to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version published by
the Free Software Foundation.
On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL.
COPYRIGHT
Copyright (C) 2009 David Bremner
sketch 0.2.159 July 7, 2009 SKETCH(1)