Skip to content

Instantly share code, notes, and snippets.

@gss200610
Forked from DominicBM/combine.py
Created September 20, 2021 10:33
Show Gist options
  • Save gss200610/a8d54375a4c0324230c0903bf8c9fe5c to your computer and use it in GitHub Desktop.
Save gss200610/a8d54375a4c0324230c0903bf8c9fe5c to your computer and use it in GitHub Desktop.

Revisions

  1. Dominic Byrd-McDevitt revised this gist Oct 6, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion combine.py
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,7 @@
    out_size = (os.stat(file).st_size / 1000000)
    except OSError:
    out_size = 0
    if (in_size + out_size) > 80:
    if (in_size + out_size) > 75:
    file = re.split('\.', outputfile)[0] + '_' + str(counter) + '.xml'
    counter = counter + 1
    with open(file, 'a') as outfile:
  2. Dominic Byrd-McDevitt revised this gist Oct 6, 2016. 1 changed file with 20 additions and 5 deletions.
    25 changes: 20 additions & 5 deletions combine.py
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,21 @@
    import os, re

    file = 'm384-import-11.xml'
    filenames = ['M384_0201_output.xml','M384_0202_output.xml','M384_0203_output.xml','M384_0204_output.xml','M384_0205_output.xml','M384_0206_output.xml','M384_0207_output.xml','M384_0208_output.xml','M384_0209_output.xml','M384_0210_output.xml','M384_0211_output.xml','M384_0212_output.xml','M384_0213_output.xml','M384_0214_output.xml','M384_0215_output.xml','M384_0216_output.xml','M384_0217_output.xml','M384_0218_output.xml','M384_0219_output.xml','M384_0220_output.xml']
    with open('m384-import-11.xml', 'w') as outfile:
    for fname in filenames:
    with open(fname) as infile:
    for line in infile:
    outfile.write(line)

    counter = 2
    outputfile = file

    for fname in filenames:
    in_size = (os.stat(fname).st_size / 1000000)
    try:
    out_size = (os.stat(file).st_size / 1000000)
    except OSError:
    out_size = 0
    if (in_size + out_size) > 80:
    file = re.split('\.', outputfile)[0] + '_' + str(counter) + '.xml'
    counter = counter + 1
    with open(file, 'a') as outfile:
    with open(fname) as infile:
    for line in infile:
    outfile.write(line)
  3. @clingerman clingerman revised this gist Sep 14, 2016. No changes.
  4. @clingerman clingerman created this gist Sep 12, 2016.
    6 changes: 6 additions & 0 deletions combine.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    filenames = ['M384_0201_output.xml','M384_0202_output.xml','M384_0203_output.xml','M384_0204_output.xml','M384_0205_output.xml','M384_0206_output.xml','M384_0207_output.xml','M384_0208_output.xml','M384_0209_output.xml','M384_0210_output.xml','M384_0211_output.xml','M384_0212_output.xml','M384_0213_output.xml','M384_0214_output.xml','M384_0215_output.xml','M384_0216_output.xml','M384_0217_output.xml','M384_0218_output.xml','M384_0219_output.xml','M384_0220_output.xml']
    with open('m384-import-11.xml', 'w') as outfile:
    for fname in filenames:
    with open(fname) as infile:
    for line in infile:
    outfile.write(line)