<commit_before>#!/bin/bash

# get source directory from arguments
SOURCE_DIR=$1

# get destination directory from arguments
DEST_DIR=$2

# set destination file path
DEST_FILE="$DEST_DIR/fits_combined_reports.xml"

#initialize output file with xml declaration
echo '<?xml version="1.0" encoding="UTF-8"?>' > $DEST_FILE

# append opening docSet tag
echo '<d:docSet' >> $DEST_FILE
echo 'xmlns:d="http://lib.ncsu.edu/schema/doc_set"' >> $DEST_FILE
echo 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' >> $DEST_FILE
echo 'xsi:schemaLocation="http://lib.ncsu.edu/schema/doc_set https://raw.githubusercontent.com/NCSU-Libraries/doc_set_schema/master/doc_set.xsd">' >> $DEST_FILE
echo '' >> $DEST_FILE

# for each file in source directory,
# write contents to $DEST_FILE, excluding xml declaration
for file in $SOURCE_DIR/*
do
  cat $file | grep -v '^<?xml' >> $DEST_FILE<commit_msg>change second argument to be full path to output file<commit_after>#!/bin/bash

# get source directory from arguments
SOURCE_DIR=$1

# get destination directory from arguments
DEST_FILE=$2

#initialize output file with xml declaration
echo '<?xml version="1.0" encoding="UTF-8"?>' > $DEST_FILE

# append opening docSet tag
echo '<d:docSet' >> $DEST_FILE
echo 'xmlns:d="http://lib.ncsu.edu/schema/doc_set"' >> $DEST_FILE
echo 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' >> $DEST_FILE
echo 'xsi:schemaLocation="http://lib.ncsu.edu/schema/doc_set https://raw.githubusercontent.com/NCSU-Libraries/doc_set_schema/master/doc_set.xsd">' >> $DEST_FILE
echo '' >> $DEST_FILE

# for each file in source directory,
# write contents to $DEST_FILE, excluding xml declaration
for file in $SOURCE_DIR/*
do
  cat $file | grep -v '^<?xml' >> $DEST_FILE
{'fraction_non_alphanumeric': 0.146242774566474, 'fraction_numerical': 0.011560693641618497, 'mean_word_length': 5.581749049429658, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 2, '>': 33, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 13}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2531946', 'n_tokens_mistral': 621, 'n_tokens_neox': 600, 'n_words': 147}