{"id":337,"date":"2022-10-18T10:25:46","date_gmt":"2022-10-18T02:25:46","guid":{"rendered":"https:\/\/islandtropicaman.com\/wp\/?p=337"},"modified":"2022-10-18T10:26:52","modified_gmt":"2022-10-18T02:26:52","slug":"swap-the-content-of-two-text-files-in-power-shell","status":"publish","type":"post","link":"https:\/\/islandtropicaman.com\/wp\/2022\/10\/18\/swap-the-content-of-two-text-files-in-power-shell\/","title":{"rendered":"Swap the content of two text files in Power Shell"},"content":{"rendered":"<p>In this article, I will show you the command to swap the content of two text files in Power Shell. Swapping the content of two text files simply means replacing the content of file number one with the content of file number two and replacing the content of file number two with the content of file number one. Although the below command can easily swap the content of two text files it is not advisable to swap the content of large files that might caused a memory crash. <\/p>\n<p>The content of the first text file before the swapping process is as follows:<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n&gt; ${e:f1.txt}\r\nworld hello!\r\n<\/pre>\n<p>The content of the second text file before the swapping process is as follows:<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n&gt; ${e:f2.txt}\r\nhello world!\r\n<\/pre>\n<p>Next, let us start the swapping process:-<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n$ {e:f1.txt}, ${e:f2.txt} = ${e:f2.txt}, ${e:f1.txt}\r\n<\/pre>\n<p>Now let us view the contents of both text files again:<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n&gt; ${e:f1.txt}\r\nhello world!\r\n&gt; ${e:f2.txt}\r\nworld hello!\r\n<\/pre>\n<p>As you can see the swap has indeed taken place as expected!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, I will show you the command to swap the content of two text files in Power Shell. Swapping the content of two text files simply means replacing the content of file number one with the content of file number two and replacing the content of file number two with the content of&#8230;<\/p>\n<p class=\"more-link-wrap\"><a href=\"https:\/\/islandtropicaman.com\/wp\/2022\/10\/18\/swap-the-content-of-two-text-files-in-power-shell\/\" class=\"more-link\">Read More<span class=\"screen-reader-text\"> &ldquo;Swap the content of two text files in Power Shell&rdquo;<\/span> &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[78],"tags":[100],"class_list":["post-337","post","type-post","status-publish","format-standard","hentry","category-power-shell","tag-swap-text-file"],"blog_post_layout_featured_media_urls":{"thumbnail":"","full":""},"categories_names":{"78":{"name":"Power Shell","link":"https:\/\/islandtropicaman.com\/wp\/category\/power-shell\/"}},"tags_names":{"100":{"name":"swap text file","link":"https:\/\/islandtropicaman.com\/wp\/tag\/swap-text-file\/"}},"comments_number":"0","_links":{"self":[{"href":"https:\/\/islandtropicaman.com\/wp\/wp-json\/wp\/v2\/posts\/337","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/islandtropicaman.com\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/islandtropicaman.com\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/islandtropicaman.com\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/islandtropicaman.com\/wp\/wp-json\/wp\/v2\/comments?post=337"}],"version-history":[{"count":2,"href":"https:\/\/islandtropicaman.com\/wp\/wp-json\/wp\/v2\/posts\/337\/revisions"}],"predecessor-version":[{"id":339,"href":"https:\/\/islandtropicaman.com\/wp\/wp-json\/wp\/v2\/posts\/337\/revisions\/339"}],"wp:attachment":[{"href":"https:\/\/islandtropicaman.com\/wp\/wp-json\/wp\/v2\/media?parent=337"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/islandtropicaman.com\/wp\/wp-json\/wp\/v2\/categories?post=337"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/islandtropicaman.com\/wp\/wp-json\/wp\/v2\/tags?post=337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}