PDA

View Full Version : Can I do this with BC ???


roddzilla
09-Aug-2005, 09:26 PM
I have a system that gives me 2 text files... we'll call them PRIMARY and BACKUP

PRIMARY will look like this:

SWITCH
100
101
102
103
104
SWITCH
105
106
107
108
SWITCH
109
110

BACKUP will look like this:

200
201
SWITCH
202
203
204
205
206
SWITCH
207
208
209
210

OUTPUT file should look like this:

100
101
202
203
204
105
106
207
208
109
110

You see, these are 2 separate servers and only 1 is broadcasting info to the world at a time (the other is redundant). The 'SWITCH' in the text file is which one is broadcasting to the world. The output file is actually what was broadcast to the world.

Basically, I need to merge PRIMARY and BACKUP file into an OUTPUT file.... contents of primary and backup that are 'taken' for the output file are dependant on the SWITCH string.

Man, I hope someone out there understands what I just attempted to communicate!

Thanks a ton for taking the time to read my dilemma.

Roddzilla

Chris
10-Aug-2005, 09:16 AM
I gave it a try, but there doesn't seem to be an easy way to merge your files together using BC.

Even if BC could do a good job of lining up the files, you would still have to manually merge them, so if your log files are decent sized it probably wouldn't be a good option.