|
|
Thread Tools | Display Modes |
![]() |
#23 | ||
![]() ![]() ![]() ![]() ![]() Join Date: Jun 2004
Location: Jan Mayen, Svalbard and Jan Mayen
Posts: 2,167
|
![]() the only thing I can think of is the line ends being different. I did convert them to unix line ends. It shouldn't matter as I compiled the executable for windows, but maybe that doesn't convert the line ends internally afteral, or maybe it needed a switch.
I used C++ to program it, it is a quick getting the job done piece of code. Let me post it here. Don't bother with pointing out all C-isms and other things which I could have done better. I know them myself as well. Code:
/* Copyright Data */ #include <string> #include <iostream> int main (int argc, char *argv[]) { std::string templine; std::string index, timeindex, text; std::string index2, timeindex2, text2; //Get initial record: getline (std::cin, index); getline (std::cin, timeindex); templine = ""; do { getline (std::cin, templine); text += templine; text += "\n"; } while (templine != ""); while (std::cin) { getline (std::cin, index2); getline (std::cin, timeindex2); templine = ""; do { getline (std::cin, templine); text2 += templine; text2 += "\n"; } while (templine != ""); //writeout record: std::cout << index << std::endl; std::cout << timeindex << std::endl; std::cout << text2; //move up: index = index2; timeindex = timeindex2; text2 = ""; } return 0; }
__________________
Flowing with the stream of life Last edited by Data; 10-10-2008 at 06:39 AM. |
||
![]() ![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Castlevania movie script revealed | TheChosen | Blah, blah, blah... | 16 | 18-07-2008 06:41 PM |
Abandonia Script? | jourdan | Old Suggestions | 4 | 09-07-2007 09:24 AM |
Script Not Working After Migrate | Reup | Old Suggestions | 1 | 25-08-2006 11:58 AM |
Annoying Script Prompt -RESOLVED | guesst | Old Suggestions | 7 | 28-07-2006 01:00 AM |
|
|
||
  |