<commit_before><!DOCTYPE html>

<html>
    <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Convert Data to String">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<title>Convert Data to String</title>

</head> 
<body style="">
<div class="container">
    <div class="row">
        <div class="page-header">
                <h1 class="text-center">Data to String</h1>
        </div>
    </div>
    <div class="row">
        <div class="container-fluid pageSubheader">
            <h2>Use this tool to convert Data into String.</h2>
        </div>
    </div>
	<div class="row">
    <div class="col-md-8">

    <p> 

    </p>
<h3 class="headerBlue">Step 1: Select your input</h3>
<form id="frm1" name="frm1" class="form-inline" role="form" onsubmit="return false">
<div class="form-group">
   <b>Option 1 - paste into Text Box below</b><br>

<textarea class="form-control" rows="10" cols="80" id="txt1" wrap="off"></textarea>
   <br><input type="button" class="btn btn-primary" value="Clear Input" onclick="window.location.reload(true)">
   &nbsp; Examples: 
      <input type="button" class="btn btn-primary" value="1" title="Load and run example" onclick="runExample(1)">
    <br>
    <h3 class="headerBlue">Step 2: Choose output options <small>(optional)</small></h3>
    <a href="#" onclick="return false" data-toggle="collapse" data-target="#p4" class="collapsed" aria-expanded="false"> <span class="glyphicon glyphicon-chevron-down"></span></a>
    <hr>
<fieldset class="scheduler-border collapse" id="p4" aria-expanded="false" style="height: 9px;">
        <legend class="scheduler-border">Output Options</legend>
    Output Field Separator: 
     <label><input type="radio" name="outsep" id="outSepComma" value="," checked="checked"> ,</label> &nbsp;    
     <label><input type="radio" name="outsep" id="outSepSemicolon" value=";"> ;</label> &nbsp;
     <label><input type="radio" name="outsep" id="outSepSemicolon" value=":"> :</label> &nbsp;
     <label><input type="radio" name="outsep" id="outSepPipe" value="|"> Bar-|</label> &nbsp;
     <label><input type="radio" name="outsep" id="outSepTab" value=" " onclick="this.value=&#39;\t&#39;"> Tab</label> &nbsp;
     <label><input type="radio" name="outsep" id="outSepOther" value="o"> Other-Choose</label>
     <label><input type="text" size="2" id="outSepOtherVal" value="*"></label>

    <br> <label><input id="js_add_quotes" type="checkbox"> add values in quotes</label>
</fieldset>

 <h3 class="headerBlue">Step 3: Generate output</h3>
 <div>
   <input type="button" id="js_btn_run" class="btn btn-primary" value="Convert Data To String" title="Convert Data To String" >

</div>
</div>

	<div class="form-group">
		<label for="js_txta" class="control-label">Result Data:</label><br>
		<textarea id="js_txta" rows="10" cols="80" wrap="off" placeholder="Output Results" class="form-control"></textarea>
	</div> <br>
	<div class="form-group form-inline">
		<label>Save your result</label>

    </div> 


   </form>


 <br>

</div>

    <div class="row">
	    <div class="col-md-12">

	        <div class="panel-footer">
                Copyright © 2013-2015
            </div>
	    </div>
    </div>	
    </div>
</div>
<script   src="https://code.jquery.com/jquery-2.2.3.min.js"   integrity="<KEY>   crossorigin="anonymous"></script> 
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="<KEY>" crossorigin="anonymous">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="<KEY>" crossorigin="anonymous">

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="<KEY>" crossorigin="anonymous"></script>

<script type="text/javascript">

function runExample(n){
    var data = [
        "test\ntest1\ntest2\ntest3\ntest4\ntest5\ntest6\ntest7",
        "test\ntest1\ntest2\ntest3\ntest4\ntest5\ntest6\ntest7",
        "test\ntest1\ntest2\ntest3\ntest4\ntest5\ntest6\ntest7"
    ];
    document.getElementById('txt1').value = data[n];
}

function assignText(s) {
   document.getElementById('txt1').value = s;
}
document.getElementById('js_btn_run').onclick = function(){
    var txt_input = document.getElementById('txt1').value;
    var separator = document.querySelector('input[name="outsep"]:checked').value;
    var quotes = document.querySelector('#js_add_quotes').checked;
    if(quotes){
        var data = txt_input.split('\n');
        for(var i in data){
            data[i] = '\''+data[i]+ '\'';
        }
        var res = data.join(separator);
    }else{
        var res = txt_input.split('\n').join(separator);
    }
    
    document.getElementById('js_txta').value = res;
};


</script>
</body></html><commit_msg>update 25.04.2016<commit_after><!DOCTYPE html>

<html>
    <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Convert Data to String">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<title>Convert Data to String</title>

</head> 
<body style="">
<div class="container">
    <div class="row">
        <div class="page-header">
                <h1 class="text-center">Data to String</h1>
        </div>
    </div>
    <div class="row">
        <div class="container-fluid pageSubheader">
            <h2>Use this tool to convert Data into String.</h2>
        </div>
    </div>
	<div class="row">
    <div class="col-md-8">

    <p> 

    </p>
<h3 class="headerBlue">Step 1: Select your input</h3>
<form id="frm1" name="frm1" class="form-inline" role="form" onsubmit="return false">
<div class="form-group">
   <b>Option 1 - paste into Text Box below</b><br>

<textarea class="form-control" rows="10" cols="80" id="txt1" wrap="off"></textarea>
   <br><input type="button" class="btn btn-primary" value="Clear Input" onclick="window.location.reload(true)">
   &nbsp; Examples: 
      <input type="button" class="btn btn-primary" value="1" title="Load and run example" onclick="runExample(1)">
    <br>
    <h3 class="headerBlue">Step 2: Choose output options <small>(optional)</small></h3>
    <a href="#" onclick="return false" data-toggle="collapse" data-target="#p4" class="collapsed" aria-expanded="false"> <span class="glyphicon glyphicon-chevron-down"></span></a>
    <hr>
<fieldset class="scheduler-border collapse" id="p4" aria-expanded="false" style="height: 9px;">
        <legend class="scheduler-border">Output Options</legend>
    Output Field Separator: 
     <label><input type="radio" name="outsep" id="outSepComma" value="," checked="checked"> ,</label> &nbsp;    
     <label><input type="radio" name="outsep" id="outSepSemicolon" value=";"> ;</label> &nbsp;
     <label><input type="radio" name="outsep" id="outSepSemicolon" value=":"> :</label> &nbsp;
     <label><input type="radio" name="outsep" id="outSepPipe" value="|"> Bar-|</label> &nbsp;
     <label><input type="radio" name="outsep" id="outSepTab" value=" " onclick="this.value=&#39;\t&#39;"> Tab</label> &nbsp;
     <label><input type="radio" name="outsep" id="outSepOther" value="o"> Other-Choose</label>
     <label><input type="text" size="2" id="outSepOtherVal" value="*"></label>

    <br> <label><input id="js_add_quotes" type="checkbox"> add values in quotes</label>
</fieldset>

 <h3 class="headerBlue">Step 3: Generate output</h3>
 <div>
   <input type="button" id="js_btn_run" class="btn btn-primary" value="Convert Data To String" title="Convert Data To String" >

</div>
</div>

	<div class="form-group">
		<label for="js_txta" class="control-label">Result Data:</label><br>
		<textarea id="js_txta" rows="10" cols="80" wrap="off" placeholder="Output Results" class="form-control"></textarea>
	</div> <br>
	<div class="form-group form-inline">
		
        <a href="" id="a"><label>Save your result</label></a>
<button class="btn btn-primary" onclick="saveFile();return false"><span class="glyphicon glyphicon-save-file"></span> Download Result</button>
    </div> 


   </form>


 <br>

</div>

    <div class="row">
	    <div class="col-md-12">

	        <div class="panel-footer">
                Copyright © 2013-2015
            </div>
	    </div>
    </div>	
    </div>
</div>
<script   src="https://code.jquery.com/jquery-2.2.3.min.js"   integrity="<KEY>   crossorigin="anonymous"></script> 
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="<KEY>" crossorigin="anonymous">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="<KEY>" crossorigin="anonymous">

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="<KEY>" crossorigin="anonymous"></script>

<script type="text/javascript">

function runExample(n){
    var data = [
        "test\ntest1\ntest2\ntest3\ntest4\ntest5\ntest6\ntest7",
        "test\ntest1\ntest2\ntest3\ntest4\ntest5\ntest6\ntest7",
        "test\ntest1\ntest2\ntest3\ntest4\ntest5\ntest6\ntest7"
    ];
    document.getElementById('txt1').value = data[n];
}

function assignText(s) {
   document.getElementById('txt1').value = s;
}

function convertData2String(txt_input,separator,quotes){
    if(quotes){
        var data = txt_input.split('\n');
        for(var i in data){
            data[i] = '\''+data[i]+ '\'';
        }
        var res = data.join(separator);
    }else{
        var res = txt_input.split('\n').join(separator);
    }
    return res;
}

document.getElementById('js_btn_run').onclick = function(){
    var txt_input = document.getElementById('txt1').value;
    var separator = document.querySelector('input[name="outsep"]:checked').value;
    var quotes = document.querySelector('#js_add_quotes').checked;
    var res = convertData2String(txt_input,separator,quotes);
    
    document.getElementById('js_txta').value = res;
};

function download(text, name, type) {
  var a = document.getElementById("a");
  var file = new Blob([text], {type: type});
  a.href = URL.createObjectURL(file);
  a.download = name;
}
function saveFile(){
    var txt_input = document.getElementById('txt1').value;
    var separator = document.querySelector('input[name="outsep"]:checked').value;
    var quotes = document.querySelector('#js_add_quotes').checked;
    var res = convertData2String(txt_input,separator,quotes);
    download(res, 'myfilename.txt',  'text/plain');
    document.getElementById('a').click();
}
</script>
</body></html>
{'fraction_non_alphanumeric': 0.19275182092734056, 'fraction_numerical': 0.016343933203055605, 'mean_word_length': 4.251399253731344, 'pattern_counts': {'":': 2, '<': 267, '<?xml version=': 0, '>': 267, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2986233', 'n_tokens_mistral': 3890, 'n_tokens_neox': 3750, 'n_words': 751}