Beginner problem c++
-
Problem c++ Hi i have an txt-file that looks like this: Bigman arnold :line1 1333131313131 :line2 blue 123 green 2, 234 green :line3 arctic 34 :line4 The thing i have to do is modify the out put from the txt file. There are many more lines. I have to modify it so the output from the files so it becomes like this: arnold Bigman :line1 blue 123 green 2, 234 green :line 2 arctic 34 :line3 1333131313131 :line4 And the lines continues for the rest of the txt file. I'we been trying ifstream with a while(file>>string1>>string2>>getline(zzzzz, file) But i get an error im totally of. Sometimes there are only 3 lines for the adress and sometimes 4. Any good ideas?
-
Problem c++ Hi i have an txt-file that looks like this: Bigman arnold :line1 1333131313131 :line2 blue 123 green 2, 234 green :line3 arctic 34 :line4 The thing i have to do is modify the out put from the txt file. There are many more lines. I have to modify it so the output from the files so it becomes like this: arnold Bigman :line1 blue 123 green 2, 234 green :line 2 arctic 34 :line3 1333131313131 :line4 And the lines continues for the rest of the txt file. I'we been trying ifstream with a while(file>>string1>>string2>>getline(zzzzz, file) But i get an error im totally of. Sometimes there are only 3 lines for the adress and sometimes 4. Any good ideas?
So are you needing to know how to read from one file and write to another, how to swap strings, or something else? I see no pattern in your input/output (e.g., line 1 swaps the two words, line 2 moves to line 4). :confused:
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
-
Problem c++ Hi i have an txt-file that looks like this: Bigman arnold :line1 1333131313131 :line2 blue 123 green 2, 234 green :line3 arctic 34 :line4 The thing i have to do is modify the out put from the txt file. There are many more lines. I have to modify it so the output from the files so it becomes like this: arnold Bigman :line1 blue 123 green 2, 234 green :line 2 arctic 34 :line3 1333131313131 :line4 And the lines continues for the rest of the txt file. I'we been trying ifstream with a while(file>>string1>>string2>>getline(zzzzz, file) But i get an error im totally of. Sometimes there are only 3 lines for the adress and sometimes 4. Any good ideas?