<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>仕事の効率化  |  ITのあれこれ</title>
	<atom:link href="https://himatoto.com/tag/%E4%BB%95%E4%BA%8B%E3%81%AE%E5%8A%B9%E7%8E%87%E5%8C%96/feed/" rel="self" type="application/rss+xml" />
	<link>https://himatoto.com</link>
	<description>初心者視点で分かりやすく</description>
	<lastBuildDate>Fri, 01 Apr 2022 00:49:44 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.2</generator>

<image>
	<url>https://himatoto.com/wp-content/uploads/2020/06/cropped-4495bed8051fcc9fd4ac4bababda36e3-32x32.png</url>
	<title>仕事の効率化  |  ITのあれこれ</title>
	<link>https://himatoto.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>テキストファイルを楽に編集する</title>
		<link>https://himatoto.com/worktechnique-1/</link>
					<comments>https://himatoto.com/worktechnique-1/#respond</comments>
		
		<dc:creator><![CDATA[himatoto]]></dc:creator>
		<pubDate>Wed, 29 Jul 2020 09:24:58 +0000</pubDate>
				<category><![CDATA[仕事の効率化]]></category>
		<category><![CDATA[テキストファイル処理]]></category>
		<category><![CDATA[キーマクロ]]></category>
		<guid isPermaLink="false">https://himatoto.com/?p=352</guid>

					<description><![CDATA[数百行、数千行、数万行のテキストファイルがあり そのテキストファイルに対して同じ繰り返しの変更処理をするようなことがあるかと思います。 そんな時、1行ずつ変更をしますか？ 1行ずつ変更をしていると何時間あっても時間が足り [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>数百行、数千行、数万行のテキストファイルがあり</p>



<p>そのテキストファイルに対して同じ繰り返しの変更処理をするようなことがあるかと思います。</p>



<p>そんな時、1行ずつ変更をしますか？</p>



<p>1行ずつ変更をしていると何時間あっても時間が足りません。</p>



<p>そんな時に使えるテキストファイルの変更方法を説明します。</p>



<p><span class="marker-red">プログラミングなどの知識がなくても簡単に処理する方法です。</span></p>




  <div id="toc" class="toc tnt-number toc-center tnt-number border-element"><input type="checkbox" class="toc-checkbox" id="toc-checkbox-2" checked><label class="toc-title" for="toc-checkbox-2">目次</label>
    <div class="toc-content">
    <ol class="toc-list open"><li><a href="#toc1" tabindex="0">経験談</a></li><li><a href="#toc2" tabindex="0">準備</a></li><li><a href="#toc3" tabindex="0">一定の文字数で改行する</a><ol><li><a href="#toc4" tabindex="0">手順</a></li></ol></li><li><a href="#toc5" tabindex="0">一定の文字数で句読点を入力する</a><ol><li><a href="#toc6" tabindex="0">手順</a></li></ol></li><li><a href="#toc7" tabindex="0">まとめ</a></li></ol>
    </div>
  </div>

<h2 class="wp-block-heading"><span id="toc1">経験談</span></h2>



<p>テキストエディタは何を使っても同じ！と思い無知だった新人時の話です。</p>



<div class="wp-block-cocoon-blocks-balloon-ex-box-1 speech-wrap sb-id-3 sbs-line sbp-l sbis-cb cf block-box"><div class="speech-person"><figure class="speech-icon"><img decoding="async" src="https://himatoto.com/wp-content/themes/cocoon-master/images/b-man.png" alt="" class="speech-icon-image"/></figure><div class="speech-name"></div></div><div class="speech-balloon">
<p>ログファイルの分析をするから、旧フォーマットで出力されているログファイルを新しいフォーマットに整形してほしい。</p>



<p>やり方は任せるから〇時までにお願い。</p>
</div></div>



<p>単純作業だから、このくらい手作業で処理しよう！と決め1行ずつ整形処理をしていた。</p>



<p>1時間・・・2時間・・・時間はたつけど、全然進まない。</p>



<p>更に途中で間違えてることに気づき、処理したところを訂正…。</p>



<p>何とか予定の時間までには終わったのですが、その日は他の作業ができず残業…。</p>



<p>後日、<span class="marker-under-red">&#8220;簡単に・早く・正確に&#8221;</span>できないか？と調べ見つけたのが<span class="marker-under-red">テキストエディタの&#8221;キーマクロ&#8221;</span>です。疑似的に同じようなことをやってみたら、圧倒的に<span class="marker-under-red">早く・正確</span>に処理ができた。</p>



<h2 class="wp-block-heading"><span id="toc2">準備</span></h2>



<p>キーマクロを使用できるテキストエディタを使用します。</p>



<p>今回はエディタを例に説明します。</p>



<ul><li>サクラエディタ</li></ul>




<a rel="noopener" href="https://sakura-editor.github.io/" title="Sakura Editor" class="blogcard-wrap external-blogcard-wrap a-wrap cf" target="_blank"><div class="blogcard external-blogcard eb-left cf"><div class="blogcard-label external-blogcard-label"><span class="fa"></span></div><figure class="blogcard-thumbnail external-blogcard-thumbnail"><img src="https://himatoto.com/wp-content/uploads/cocoon-resources/blog-card-cache/786ba5be9b9a1c1cda74872ee3a13c38.png" alt="" class="blogcard-thumb-image external-blogcard-thumb-image" width="160" height="90" loading="lazy" decoding="async" /></figure><div class="blogcard-content external-blogcard-content"><div class="blogcard-title external-blogcard-title">Sakura Editor</div><div class="blogcard-snippet external-blogcard-snippet">Japanese text editor for MS Windows</div></div><div class="blogcard-footer external-blogcard-footer cf"><div class="blogcard-site external-blogcard-site"><div class="blogcard-favicon external-blogcard-favicon"><img src="https://www.google.com/s2/favicons?domain=https://sakura-editor.github.io" alt="" class="blogcard-favicon-image external-blogcard-favicon-image" width="16" height="16" loading="lazy" decoding="async" /></div><div class="blogcard-domain external-blogcard-domain">sakura-editor.github.io</div></div></div></div></a>




<h2 class="wp-block-heading"><span id="toc3">一定の文字数で改行する</span></h2>



<p>5文字目の後に改行を入れる方法について説明します。</p>



<p>完成イメージは下記の通りです。</p>



<p>【変更前】のテキストファイル</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="608" height="538" src="https://himatoto.com/wp-content/uploads/2020/07/sakura1.png" alt="" class="wp-image-364" srcset="https://himatoto.com/wp-content/uploads/2020/07/sakura1.png 608w, https://himatoto.com/wp-content/uploads/2020/07/sakura1-300x265.png 300w" sizes="(max-width: 608px) 100vw, 608px" /></figure></div>



<p>【変更後】のテキストファイル</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="609" height="538" src="https://himatoto.com/wp-content/uploads/2020/07/sakura2.png" alt="" class="wp-image-365" srcset="https://himatoto.com/wp-content/uploads/2020/07/sakura2.png 609w, https://himatoto.com/wp-content/uploads/2020/07/sakura2-300x265.png 300w" sizes="(max-width: 609px) 100vw, 609px" /></figure></div>



<p>この変更処理をする場合、前提条件があります。</p>



<p><span class="marker-under-red">テキストファイルの内容に一定の規則性があること</span></p>



<h3 class="wp-block-heading"><span id="toc4">手順</span></h3>



<p>1．サクラエディタで対象のファイルを開く。</p>



<p>2．左上にカーソルをあわせる。</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="605" height="200" src="https://himatoto.com/wp-content/uploads/2020/07/sakura3.png" alt="" class="wp-image-366" srcset="https://himatoto.com/wp-content/uploads/2020/07/sakura3.png 605w, https://himatoto.com/wp-content/uploads/2020/07/sakura3-300x99.png 300w" sizes="(max-width: 605px) 100vw, 605px" /></figure></div>



<p>3．キーマクロの設定を行うために、「ctil」＋「shift」＋「M」を押すしてキーマクロを開始する。</p>



<p>　　※ツールバーの「ツール＞キーマクロの記録開始」でもOK</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="609" height="200" src="https://himatoto.com/wp-content/uploads/2020/07/sakura4.png" alt="" class="wp-image-367" srcset="https://himatoto.com/wp-content/uploads/2020/07/sakura4.png 609w, https://himatoto.com/wp-content/uploads/2020/07/sakura4-300x99.png 300w" sizes="(max-width: 609px) 100vw, 609px" /></figure></div>



<p>4．キーボードで改行を挿入する手順を入力する。</p>



<p>　　4-1．カーソルを右矢印で5個移動させる。</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="609" height="200" src="https://himatoto.com/wp-content/uploads/2020/07/sakura5.png" alt="" class="wp-image-368" srcset="https://himatoto.com/wp-content/uploads/2020/07/sakura5.png 609w, https://himatoto.com/wp-content/uploads/2020/07/sakura5-300x99.png 300w" sizes="(max-width: 609px) 100vw, 609px" /></figure></div>



<p> 　4-2．改行を入力する。</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="609" height="200" src="https://himatoto.com/wp-content/uploads/2020/07/sakura6-1.png" alt="" class="wp-image-374" srcset="https://himatoto.com/wp-content/uploads/2020/07/sakura6-1.png 609w, https://himatoto.com/wp-content/uploads/2020/07/sakura6-1-300x99.png 300w" sizes="(max-width: 609px) 100vw, 609px" /></figure></div>



<p>　4-3．4-1～4-2を5回繰り返す。</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="609" height="230" src="https://himatoto.com/wp-content/uploads/2020/07/sakura7-1.png" alt="" class="wp-image-372" srcset="https://himatoto.com/wp-content/uploads/2020/07/sakura7-1.png 609w, https://himatoto.com/wp-content/uploads/2020/07/sakura7-1-300x113.png 300w" sizes="(max-width: 609px) 100vw, 609px" /></figure></div>



<p>　4-4．次の行の先頭にカーソルを合わせる。</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="609" height="230" src="https://himatoto.com/wp-content/uploads/2020/07/sakura8-1.png" alt="" class="wp-image-378" srcset="https://himatoto.com/wp-content/uploads/2020/07/sakura8-1.png 609w, https://himatoto.com/wp-content/uploads/2020/07/sakura8-1-300x113.png 300w" sizes="(max-width: 609px) 100vw, 609px" /></figure></div>



<p>　4-5．入力した内容を保存するため、「ctil」＋「shift」＋「M」を押してキーマクロを終了する。</p>



<p>　　※ツールバーの「ツール＞キーマクロの記録終了」でもOK</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="609" height="230" src="https://himatoto.com/wp-content/uploads/2020/07/sakura9.png" alt="" class="wp-image-380" srcset="https://himatoto.com/wp-content/uploads/2020/07/sakura9.png 609w, https://himatoto.com/wp-content/uploads/2020/07/sakura9-300x113.png 300w" sizes="(max-width: 609px) 100vw, 609px" /></figure></div>



<p>　4-6．「ctil」＋「shift」＋「M」を押してキーマクロを実行する。</p>



<p>　　※ツールバーの「ツール＞キーマクロの実行」でもOK</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="609" height="350" src="https://himatoto.com/wp-content/uploads/2020/07/sakura10-1.png" alt="" class="wp-image-383" srcset="https://himatoto.com/wp-content/uploads/2020/07/sakura10-1.png 609w, https://himatoto.com/wp-content/uploads/2020/07/sakura10-1-300x172.png 300w, https://himatoto.com/wp-content/uploads/2020/07/sakura10-1-120x68.png 120w" sizes="(max-width: 609px) 100vw, 609px" /></figure></div>



<p>　4-7．最後の行が処理されるまで4-6を実行する。</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="609" height="539" src="https://himatoto.com/wp-content/uploads/2020/07/sakura11.png" alt="" class="wp-image-385" srcset="https://himatoto.com/wp-content/uploads/2020/07/sakura11.png 609w, https://himatoto.com/wp-content/uploads/2020/07/sakura11-300x266.png 300w" sizes="(max-width: 609px) 100vw, 609px" /></figure></div>



<h2 class="wp-block-heading"><span id="toc5">一定の文字数で句読点を入力する</span></h2>



<p>5文字目の後に句読点を入れる方法について説明します。</p>



<p>【変更前】のテキストファイル</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="608" height="538" src="https://himatoto.com/wp-content/uploads/2020/07/sakura1-1.png" alt="" class="wp-image-388" srcset="https://himatoto.com/wp-content/uploads/2020/07/sakura1-1.png 608w, https://himatoto.com/wp-content/uploads/2020/07/sakura1-1-300x265.png 300w" sizes="(max-width: 608px) 100vw, 608px" /></figure></div>



<p>【変更後】のテキストファイル</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="609" height="539" src="https://himatoto.com/wp-content/uploads/2020/07/sakura12.png" alt="" class="wp-image-389" srcset="https://himatoto.com/wp-content/uploads/2020/07/sakura12.png 609w, https://himatoto.com/wp-content/uploads/2020/07/sakura12-300x266.png 300w" sizes="(max-width: 609px) 100vw, 609px" /></figure></div>



<h3 class="wp-block-heading"><span id="toc6">手順</span></h3>



<p>「一定文字数で改行する」の時手順と同じです。</p>



<p>この時「改行」の部分を「句読点」に置き換えてキーマクロを保存することで今回やりたいことができます。</p>



<h2 class="wp-block-heading"><span id="toc7">まとめ</span></h2>



<ul><li>テキストファイルの規則性を見つける。</li><li>キーボードで操作できることは、キーマクロとして保存して実行できる。</li><li>処理する行数が多い程時間短縮ができる。</li></ul>



<p>単純な作業をどれだけ早く、正確に処理することが仕事においてとても大切です。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://himatoto.com/worktechnique-1/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
