Overclock.net - Overclocking.net
     
 
Home Gallery Reviews Blogs Register Today's Posts Mark Forums Read Members List


Go Back   Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming > Application Programming

Reply
 
LinkBack Thread Tools
Old 06-30-08   #11 (permalink)
Security Sleuth
 
Pooping^fish's Avatar
 
intel nvidia

Join Date: Jul 2007
Location: oklahoma
Posts: 907

Rep: 44 Pooping^fish is acknowledged by some
Unique Rep: 40
Trader Rating: 2
Default

It looks like what he posted is coming from linux, as a.out is the output of an unnamed compiled program. I wont take the time to write this (I dont think I could..) but itll have to consist of the program sifting through the text of your template files, searching for specified tags, and then inserting your data inbetween them. Sounds complicated.

I did however write a program a little bit back with the wonderful help of Hobo as usual and others here called Web Page Maker that will generate you a quick and simple html page.
You could possibly mess with that then migrate the other stuff from the templates if wanted. Not sure if thatll help at all.
__________________
Quote:
"O, hai! Want som pRon? Dwnlod ths kodk frst. Its teh bst pRonz ever, we prmis." -GibbyGano
Proud Member of the Linux Gaming Community
I am your friend.

System: CSS Pwner
CPU
e6400 @ 3.2
Motherboard
p5n-t 780i
Memory
2gb ocz @ 900
Graphics Card
8800gtx
Hard Drive
7200.10 250gb
Sound Card
X-FI Extreme Music
Power Supply
750w Toughpower
Case
Lian li pc-65
CPU cooling
TRUE
GPU cooling
stock
OS
Arch Linux, XP for games
Monitor
24" Westy
Pooping^fish is offline   Reply With Quote
Old 06-30-08   #12 (permalink)
Every base is base 10
 
rabidgnome229's Avatar
 
intel nvidia

Join Date: Feb 2006
Location: Pittsburgh
Posts: 5,009
Blog Entries: 1

Rep: 566 rabidgnome229 is becoming famousrabidgnome229 is becoming famousrabidgnome229 is becoming famousrabidgnome229 is becoming famousrabidgnome229 is becoming famousrabidgnome229 is becoming famous
Unique Rep: 338
FAQs Submitted: 6
Trader Rating: 5
Default

I misread the task you needed

Code:
#include <iostream>
#include <fstream>
#include <string>

using namespace std;

int main(int argc, char **argv){

	const int buff_size = 1024;
	ofstream fout;
	ifstream fin;
	string input, delim;
	char buff[buff_size];
	
	if(argc < 4){
		cout << "Usage: ./a.out <infile> <delimeter> <outfile>" << endl;
		cout << "Enter input filename: ";	cin >> input;
		fin.open(input.c_str());
		
		cout << "Enter output filename: ";	cin >> input;
		fout.open(input.c_str());
		
		cout << "Enter delimeter: ";	cin >> input;
		delim.assign(input);
	}else{
		fin.open(argv[1]);
		fout.open(argv[3]);
		delim.assign(argv[2]);
	
		cout << "Searching " << argv[1] << " for " << delim << endl;
		cout << "Output directed to " << argv[3] << endl;
	}

	cout << endl;

	while(!fin.eof()){
		fin.getline(buff, (streamsize)buff_size);
		input.assign(buff);
		
		string::size_type index;
		while((index = input.find(delim, 0)) != string::npos){
			string rep;
			cout << input << endl << "Enter string to replace " << delim << ": ";
			cin >> rep;
			input.erase(index, delim.length());
			input.insert(index, rep);
			input.append(1, 'n');
		}
		
		fout << input;
	}

	fin.close();
	fout.close();
}
Give it as arguments an input file, the string that marks where you need something replaced (e.g. use XXXX everywhere there's an 'x' point), then the output file. If you give no arguments it prompts you for these.

When it comes upon an instance of XXXX (or whatever) it outputs the line and asks for what you want to replace it with.

Quote:
Originally Posted by Pooping^fish View Post
It looks like what he posted is coming from linux, as a.out is the output of an unnamed compiled program. I wont take the time to write this (I dont think I could..) but itll have to consist of the program sifting through the text of your template files, searching for specified tags, and then inserting your data inbetween them. Sounds complicated.

I did however write a program a little bit back with the wonderful help of Hobo as usual and others here called Web Page Maker that will generate you a quick and simple html page.
You could possibly mess with that then migrate the other stuff from the templates if wanted. Not sure if thatll help at all.
OS X, but yeah - its UNIX . a.out is the ouput that gcc (or g++ in this case) defaults to.
__________________
BIG BROTHER
Apple doesn't love you

IS WATCHING

System: It goes to eleven
CPU
E6300
Motherboard
DS3
Memory
2GB XMS2 DDR2-800
Graphics Card
EVGA 8600GTS
Hard Drive
1.294 TB
Sound Card
Audigy 2 ZS
Power Supply
Corsair 520HX
Case
Lian-Li v1000B Plus
CPU cooling
TTBT
GPU cooling
Thermalright V2
OS
Arch Linux/XP
Monitor
Samsung 226bw

Last edited by rabidgnome229 : 06-30-08 at 08:28 PM.
rabidgnome229 is offline Overclocked Account   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools



All times are GMT -4. The time now is 04:04 AM.


Overclock.net is a Carbon Neutral Site Creative Commons License Internet Security By ControlScan

Terms of Service / Forum Rules | Privacy Policy | Advertising | Become an Official Vendor
Copyright © 2008 Shogun Interactive Development. Most rights reserved.
Page generated in 0.24658 seconds with 8 queries