Bob is absolutly correct respect the difference between Merge and Concatenate. By the way, his example of master / detail in COBOL took me nostalgically back to the beginning of my career.
What I understood from Rainier mail was simple concatenation, and that is what my sample code does (although I named "Merge" that procedure!).
I apologize if my encoded material did not open correctly, here is it back again.
Greetings:
René Dorta.
StdCoder.Decode ..,, ..6Y....3QwdONl9RhOO9vRbf9b8R7fJHPNGomCrlAyIhgs,CbKBhZ
xi2,CoruKu4qouqm8rtuGfa4.hOO9vRb1Y66wb8RTfQ9vQRtIdvPZHWKqtCa.E.U5UJ4,2.5Qw
dONlnayKmKKqCLLCJuGqayKm6F9vQ5nsH3.bnayKmKa2,Cor.kay4.qorGqmQCU2,CJuyKtQC9
8P9PP7ONbXmb.2.og4k5EjO.,E.kbF.86.QC18RdfQHfMf9R9vQ7ONb1E.kHU.EBU.U,.JFcCJ
,U.2m,.p01cUZj06.,UgU.UO.,.16.c8.2UwK.M,ENE,8Mtf.0E..UO.,.1.e0M.6YE.4AYo,E
,W,0kv8.zTHT8Ff8H986VeQHfRPONZvN9vCPM1HOHVuHZ8J,dFH9P9vQN76TORdvCPM1dOKVOF
,dEffNBPNZ96v76VuHHeHdOFZ86duH,NEZeI1OK,tHB863OKdOFrN1P6IZuH5OF7OJZOF,NH9f
QDHJ0GIaIb0Gs4KuWKK0Gr4qqKqMmGEuqkcAN76RPMQau2Y4BhgFLuokqadQbBAVcIZUgdZJCC
LE0rkGbjohVhhZB40rkG5EN0mouKuyKE0rk.QaUgV7AV33fI3YjpgUohVhBZVn3YpRiZZgUAgn
3Y33fI3Yaxhm3YiBACn4ak2Somuqm8rkmqoerkGroyKr0moCbihgZZgZZgUogjlt0rmCqoOqou
qn0GmaKnOqmggiZin3YkBACr4ak28mrGql8GE0GnaKqKaUAgmhgUohjZiUQgjphXBgohgiBgWZ
hZ3YdphUYicBhn3YrBgt3YeAZBAV7gV7oe,JeUogg2YbJbUo6c9BOONnR0GqyqleHEO2CbAxhX
BgoxhmRbUIiu2Y4BBcI9PM7PNZvC,tR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E.QE.sQRtIQeoBjghg2hgn7.X5.u0n9PU.Iy6U..60cKE.cU.UiAco,EWE.Y.2..EGE.4E.2.
,.,tcp00EcCJ,wnjl.k.E.0.3gwJ.0..I16.M.EJ.,6.0E65.2..2p1...
--- end of encoding ---
On Thu, Jul 26, 2012 at 4:23 PM, Bob Walkden <bob{([at]})nowhere.xy
Do you mean merge, or do you mean concatenate, or is it the task of reading
ASCII files that is important?
Rene has probably given you the best approach to reading ASCII files.
Concatenate typically means adding one to the end of the other, whereas
merge means interleaving the contents in some way (which might
coincidentally result in concatentation!) but they are different problems.
Concatenating them is easy and shouldn't require Blackbox - you could do it
with Windows command line.
The ease or difficulty of merging them depends on their structure and on the
merging rules, so it's not really possible to give a simple answer. Back in
my COBOL programming days it was a common requirement to merge files,
typically a file of transactions with a master file to produce a new master
file.
The Jackson Structured Programming method describes a way of handling
merging problems (among others) based on describing the structure of each
input file and output as, effectively, a regular expression. It then
provides rules for matching elements and for resolving difficulties. These
result in a program structure which is easy to code and produces very
efficient results. It is very similar to the recursive descent approach to
writing compilers, and the structure charts / regular expressions are
equivalent to ebnf for describing the syntax of languages.
So, after writing all that, I think I'm saying it might be easier to help if
we knew the structure of your input texts, how to match the different
elements, and what is the desired structure of the output file.
B
> -----Original Message-----
> From: BlackBox [mailto:BLACKBOX{([at]})nowhere.xy > Neubauer
> Sent: 26 July 2012 17:03
> To: BLACKBOX{([at]})nowhere.xy > Subject: [BLACKBOX] How to concatenate ASCII files
>
> Hi all,
> in the near future I will have to programatically merge two or three
> ASCII files into one new file.
> Does anybody have a hint how to do this in a simple manner ?
> I had a look at the interface of module WinApi but could not find a
> procedure for this task.
> Reading the files line by line into a buffer and writing the contents
> to a new file seems to be a bit nasty.
>
> Best regards,
> Rainer
>
> ----
> To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to
> LISTSERV{([at]})nowhere.xy
----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy
---- To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy
BEGIN:VCARD
FN:(null)
N:;;;;
VERSION: 3.0
END:VCARD
Received on Sat Jul 28 2012 - 00:35:22 UTC