<commit_before>---
layout: post
title: "Linux sed"
date:   2017-08-21 00:00 IST
categories: ["linux", "shell", "sed"]
tags: ["linux", "shell", "sed"]
comments: true
analytics: true
---

<span/>

<span style="color: #0645ad; font-size:20px">Table of Content<span/>

  * TOC
  {:toc}

## 1. Reference

[sed命令中如何讲一个特殊字符（比如"|"）替换为换行符？](https://zhidao.baidu.com/question/381342419.html?qbl=relate_question_0&word=sed%CC%E6%BB%BB%BB%BB%D0%D0%B7%FB)


## 2. sed replace '\n' with newline in Mac OSX

~~~
$ sed -i.back 's:\\n:\'$'\n:g' test.html
~~~
<commit_msg>Update post<commit_after>---
layout: post
title: "Linux sed"
date:   2017-08-21 00:00 IST
categories: ["linux", "shell", "sed"]
tags: ["linux", "shell", "sed"]
comments: true
analytics: true
---

<span/>

<span style="color: #0645ad; font-size:20px">Table of Content<span/>

  * TOC
  {:toc}

## 1. Reference



## 2. sed replace '\n' with newline in Mac OSX

~~~
$ sed -i.back 's:\\n:\'$'\n:g' test.html
~~~

{'fraction_non_alphanumeric': 0.22429906542056074, 'fraction_numerical': 0.056074766355140186, 'mean_word_length': 4.182795698924731, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '4097011', 'n_tokens_mistral': 459, 'n_tokens_neox': 424, 'n_words': 94}