file1 is a template. might have kinds of 'funny' characters.
sample:
file2 is a file that contains lots of text. this might be very big. might have 'funny' characters as well.
sample:
my question is, how do i read file1, replace <my_content> with the content of file2, and store/print out the result?
i've tried to use sed, i firstly escape the content of file2, these characters: \ &
then i use sed substitute. but when file2 gets very big, sed would display error that the parameter is too long.
any suggestions on how to do this? i do not need the regex feature. just search that <my_content> and replace it with the content from file2.
Hope you can modify your template like (so that "<my_content>" has its own line).
Then this works (takes everything before "<my_content>" , the file2 and then everything after "<my_content>" )
If "<my_content>" is an html comment, you can remove everything after the pipes in the script, it will leave the comment in the output file as markers to see where you've put your data.
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)
Hello.
I want to copy temp files when I make a new file by vi.
For example,
09:32:52 ~/ $ mkdir test
09:33:03 ~/ $ cd test/
09:33:09 ~/test/ $ ls
09:33:16 ~/test/ $ vi test.cpp
09:34:37 ~/test/ $ cat test.cpp
#include <iostream>
int main()
{
}
09:34:48 ~/test/ $ vi test.bash
09:35:19... (1 Reply)
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)