Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Application Programming › Anyone wanna code a quick program for me for $5?
New Posts  All Forums:Forum Nav:

Anyone wanna code a quick program for me for $5? - Page 2

post #11 of 12
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.
ragequit
(13 items)
 
  
CPUMotherboardGraphicsRAM
Q9550 4ghz @ 1.25v Asus Max 2 formula 8800gtx 610/1ghz OCZ LV blade 1:1 950mhz 
Hard DriveOptical DriveOSMonitor
7200.10 250gb dvd leetlinucks 24" Westy 
KeyboardPowerCaseMouse
G15 750w Toughpower Lian li pc-65 Copperhead 
Mouse Pad
Thermtaltake? 
  hide details  
Reply
ragequit
(13 items)
 
  
CPUMotherboardGraphicsRAM
Q9550 4ghz @ 1.25v Asus Max 2 formula 8800gtx 610/1ghz OCZ LV blade 1:1 950mhz 
Hard DriveOptical DriveOSMonitor
7200.10 250gb dvd leetlinucks 24" Westy 
KeyboardPowerCaseMouse
G15 750w Toughpower Lian li pc-65 Copperhead 
Mouse Pad
Thermtaltake? 
  hide details  
Reply
post #12 of 12
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.
Edited by rabidgnome229 - 6/30/08 at 4:28pm
It goes to eleven
(13 items)
 
  
CPUMotherboardGraphicsRAM
E6300 DS3 EVGA 8600GTS 2GB XMS2 DDR2-800 
Hard DriveOSMonitorKeyboard
1.294 TB Arch Linux/XP Samsung 226bw Eclipse II 
PowerCaseMouse
Corsair 520HX Lian-Li v1000B Plus G7 
  hide details  
Reply
It goes to eleven
(13 items)
 
  
CPUMotherboardGraphicsRAM
E6300 DS3 EVGA 8600GTS 2GB XMS2 DDR2-800 
Hard DriveOSMonitorKeyboard
1.294 TB Arch Linux/XP Samsung 226bw Eclipse II 
PowerCaseMouse
Corsair 520HX Lian-Li v1000B Plus G7 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Application Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Application Programming › Anyone wanna code a quick program for me for $5?