How to create txt file on windows

Disclosure: Bonkers About Tech is supported by its readers. When you purchase through links on our site, we may earn an affiliate commission. Thank you.

Text files are super useful and I use them all the time to save temporary information in them whether its a note to remind me of something, a phone number or even a link to a website I’ve come across.

However, if you’re a computer newbie, or don’t do this kind of thing very often, you might not be in the know.

If you’re in that category, then this post if for you so let’s get stuck in, shall we?

What you will learn

  • What a text file is
  • How to access Notepad
  • How to create a new text file from your Desktop
  • How to create a text file from the command line

What is a Text File?

So a text file does exactly what it says on the tin.  

It’s a file containing just «text» and nothing else.  So you don’t get any text formatting (such as «bold», «italics» etc) and you don’t get any images, different font sizes or different fonts to choose from.

If you need to create a document with images, different fonts etc, then you need to create a Microsoft Word document or similar.

How to access Notepad

So the easiest way to access Notepad, which is bundled as part of Windows is as follows

  1. Right click the Start menu
  2. Select «Run»
  3. Type Notepad and hit enter

Run Dialog Windows 10

Personally I use Notepad++ which, in my opinion, is one of the best Notepad applications out there, and certainly a lot better than the standard Notepad application that comes with Windows.

If you install Notepad++, you can launch it in a similar way, just by typing Notepad++ in the «Run» window, as above.

How to create a new text file from your Desktop

So this is really easy to do, the steps are as follows:

  1. Press Windows+D so that you have a clear view of your desktop.
  2. Right click and select New
  3. Then click Text Document

Create New Text Document Windows 10

So that will create you a brand new text document on your desktop.  You can name it what you like and you can edit the file in Notepad, Notepad++, Microsoft word or whatever you like.

To edit the file, right click on the file and select «Edit».

If you’re using Notepad++, there’s a shortcut that says «Edit with Notepad++».  Or if you want to open it in Word, simply click «Open with» and then find the app on your computer that you’d like to open the file.

Edit Text Document With Notepad++

Don’t want the file on your desktop?  No worries, this will work in any location on your computer.  So you can create a new text file on your C drive for example.

How to create a text file from the command line

Another way of creating a text file is from the command line.

  1. Right click start and select «Run»
  2. In the dialog that pops up, type cmd and hit OK.
  3. Type echo.>mytextfile.txt

This will create an empty text file in the current directory.  Be sure to enter it exactly as above without spaces.

Create New Text File Using Windows 10 Command Prompt

You can also create a new text file by typing start notepad mytextfile.txt.

So there you go, two very simple ways of creating text files.  It’s very handy to create a text file to quickly type a note for yourself, to take down a telephone number whilst your on the phone or anything your fancy.

Cheers!

Все способы:

  • Способ 1: Контекстное меню
  • Способ 2: Запуск приложения «Блокнот»
  • Способ 3: Использование приложения WordPad
  • Способ 4: Консоль
    • «Командная строка»
    • «Терминал»
  • Вопросы и ответы: 0

Если вы попали в эту статью не узнать о способах создания текстового документа, а по причине того, что создать его не удается, ознакомьтесь с нашей инструкцией, где описаны разные решения этой неполадки.

Подробнее: Решаем проблему с созданием текстового документа в Windows 11

Способ 1: Контекстное меню

Довольно простой метод создания обычного TXT-документа заключается в использовании контекстного меню.

  1. Его можно вызвать не только на рабочем столе, как показано ниже, но и в любой папке, кликнув правой кнопкой мыши по пустому месту. Наведите курсор на «Создать» и выберите «Текстовый документ».
  2. Как создать текстовый документ в Windows 11-01

  3. Вы увидите созданный файл без названия и с расширением .txt. Введите любое название файла и нажмите Enter. Если создаете файл для выполнения скрипта, расширение тоже отредактируйте на .reg или .bat (открыть потом сам документ для редактирования можно через ПКМ по нему > «Открыть с помощью» > «Блокнот», в то время как нажатие ЛКМ запустит файл, который у вас после создания, естественно, пустой). Менять расширение на условный .docx нельзя, поскольку у системы отсутствуют такие возможности по преобразованию. Доступно конвертирование только в более простые типы типа .rtf.
  4. Откройте документ, введите туда нужный текст и сохраните его, нажав клавиши Ctrl + S либо вызывав меню «Файл» в верхней части окна.

    Через него же можете выбрать опцию «Сохранить как», чтобы переименовать созданный документ, изменить для него путь и задать другую кодировку. Обратите внимание, что в результате такого сохранения вы создадите отдельный файл, то есть изначально созданный документ через контекстное меню останется в первоначальном виде (пустым), а то, что вы сохраняете, появится в указанной директории отдельным файлом.

  5. Как создать текстовый документ в Windows 11-03

Способ 2: Запуск приложения «Блокнот»

Рассмотренный выше процесс создания и наполнения текстового файла выполнялся через системное приложение «Блокнот». Оно встроено в Windows по умолчанию и, как правило, именно им пользуются для создания TXT-файлов.

Соответственно, запустив это приложение через «Пуск» или другим удобным способом, вы сможете создавать текстовые документы и сохранять их в любом месте на компьютере.

Как создать текстовый документ в Windows 11-04

В отличие от предыдущего способа, здесь не создается текстовый документ, который остается отдельным файлом в результате использования функции «Сохранить как».

Если вы запускаете приложения альтернативными вариантами, то открыть «Блокнот» можете командой notepad либо notepad.exe.

Способ 3: Использование приложения WordPad

В Windows существует и простой текстовый редактор, тем не менее предоставляющий больше функций по форматированию и работе с документами, нежели примитивный «Блокнот».

  1. Через системный поиск отыщите приложение «WordPad» и запустите его.
  2. Как создать текстовый документ в Windows 11-016

  3. Введите текст и оформите его при помощи доступных инструментов. Учитывайте особенности расширений — например, при сохранении в TXT все форматирование будет удалено.
  4. Как создать текстовый документ в Windows 11-017

  5. Выбрать расширение или задать свое можно из списка в «Файл» > «Сохранить как».
  6. Как создать текстовый документ в Windows 11-018

Способ 4: Консоль

В зависимости от выбранной консоли необходимо задействовать разные команды для создания текстового документа. Запустить любую из консолей вы можете, кликнув правой кнопкой мыши по «Пуску» и выбрав пункт «Терминал» или «Терминал (Администратор)», если требуется создать файл в одной из системных директорий.

«Командная строка»

Классическая «Командная строка» позволяет создать как пустой текстовый документ, так и с текстом. Единственный минус — не поддерживаются кириллические символы.

  1. Запустить эту консоль можно в «Терминале», кликнув по кнопке со стрелкой вниз и из выпадающего списка выбрав «Командная строка».
  2. Как создать текстовый документ в Windows 11-06

  3. Самая известная команда для выполнения поставленной задачи — copy con C:\Путь\К\Файлу\НазваниеДокумента.txt. В нашем примере это copy con C:\lumpics.txt. Если вам надо создать документ, например, на рабочем столе, команда будет выглядеть следующим образом: C:\Users\Имя_Пользователя\Desktop\lumpics.txt, где вместо Имя_Пользователя — название вашей учетной записи, а вместо lumpics — имя файла.

    Аналогичные пути будут и к другим часто используемым директориям: C:\Users\Имя_Пользователя\Documents — для папки «Документы», C:\Users\Имя_Пользователя\Downloads — для папки «Загрузки». Конечно, вместо директорий на системном диске вы можете сохранять файлы и на другие тома, например на D.

  4. Как создать текстовый документ в Windows 11-07

  5. Сформировав команду, нажмите Enter. В результате курсор переместится на строку ниже, где вам понадобится ввести текст, который и будет сохранен внутри документа.
  6. Как создать текстовый документ в Windows 11-08

  7. Теперь нажмите Ctrl + Z, а затем Enter для сохранения документа. Уведомление об этом вы увидите в виде строки «Скопировано файлов: 1». Отметим, что после нажатия Ctrl + Z в конце текста появятся символы ^Z, однако в самом документе их не будет.
  8. Как создать текстовый документ в Windows 11-09

  9. Как видите, файл успешно создался в выбранной директории.
  10. Как создать текстовый документ в Windows 11-010

  11. А в нем содержится введенный через консоль текст.
  12. Как создать текстовый документ в Windows 11-011

  13. Однако, если вы захотите создать документ с кириллическими символами, то сделать это не получится.
  14. Как создать текстовый документ в Windows 11-012

  15. Как уже было сказано выше, вместо текста будут отображаться кракозябры.
  16. Как создать текстовый документ в Windows 11-013

  • Помимо copy con, текстовый документ с содержимым можно создать и через команду echo Ваш текст > "C:\Путь\К\Файлу\НазваниеДокумента.txt", заменив Ваш текст нужным текстом, C:\Путь\К\Файлу — на директорию, где будет создан документ, НазваниеДокумента — на имя файла. Кириллические символы тут так же нормально не отобразятся.
  • Как создать текстовый документ в Windows 11-019

  • Для пустого текстового документа используйте команду type NUL > "C:\Путь\К\Файлу\НазваниеДокумента.txt".
    Как создать текстовый документ в Windows 11-020

    Пустой файл успешно создан.

    Как создать текстовый документ в Windows 11-021

«Терминал»

Через современный «Терминал», работающий на базе «PowerShell», также можно реализовать задуманное. В отличие от «Командной строки», при создании документа с текстом вы сможете использовать кириллические символы. Однако сами по себе команды длиннее, и от этого труднее запоминаются.

  • Если вас интересует создание документа сразу с текстом, воспользуйтесь командой Set-Content -Path "C:\Путь\Файлу\НазваниеДокумента.txt" -Value "Ваш текст". Вводимый текст можете переносить на новую строку, нажимая Ctrl + Enter. При нажатии просто на Enter команда будет выполнена.

    Как создать текстовый документ в Windows 11-022

    Как видно, кириллические символы корректно сохраняются наряду с латиницей.

    Как создать текстовый документ в Windows 11-023

  • Команда, создающая пустой текстовый файл, выглядит следующим образом: New-Item -ItemType file -Path "C:\Путь\К\Файлу\НазваниеДокумента.txt".
  • Как создать текстовый документ в Windows 11-014

Наша группа в TelegramПолезные советы и помощь

Создание текстового файла — одна из самых простых, но часто необходимых операций при работе с компьютером. Рассказываем о том, как сделать это разными способами на ПК и смартфонах.

Для чего может понадобиться текстовый файл

Текстовые файлы удобны для хранения или передачи информации между компьютерами, так как формат TXT поддерживается практически в любой операционной системе. Такие файлы часто применяют для написания скриптов, настройки программ или простого обмена текстом без форматирования. Благодаря минимальному размеру они открываются быстро и занимают мало места на диске.

Как создать текстовый файл на ПК

Через контекстное меню

Самый просто способ, в котором важно, чтобы у вас нормально работали клавиатура и мышь.

  • Откройте нужную папку или рабочий стол;

  • Щелкните правой кнопкой мыши в свободной области;

Источник: TechEpu / Создание текстового документа

Источник: TechEpu / Создание текстового документа

  • В выпавшем меню выберите «Создать» > «Текстовый документ»;

  • Введите имя файла и нажмите Enter.

Теперь можете открыть файл и начать вводить текст. Не забывайте периодически сохранять его, чтобы ничего не потерялось.

С помощью «Блокнота» (Notepad)

Это базовая утилита, которая уже вшита в операционную систему Windows. Вот как ее можно найти:

  • Нажмите сочетание клавиш Win + S и введите «Блокнот»;

  • Откройте программу;

  • Напишите или вставьте нужный текст;

Источник: thecoderworld / Запуск «Блокнота»

Источник: thecoderworld / Запуск «Блокнота»

  • Нажмите «Файл» > «Сохранить как…»;

  • Выберите папку, задайте имя файла с расширением `.txt`, нажмите «Сохранить».

Источник: thecoderworld / Сохранение текстового документа

Источник: thecoderworld / Сохранение текстового документа

Через «Проводник»

Еще один простой способ — создать файл TXT прямо в проводнике, используя интерфейс окон в Windows.

  • Откройте проводник Windows (сочетание клавиш Win + E);

  • Перейдите в нужную папку;

Источник: Tech Pro Advice / Создание текстового документа

Источник: Tech Pro Advice / Создание текстового документа

  • Нажмите «Файл» > «Создать» > «Текстовый документ» в левом верхнем углу окна;

  • Переименуйте файл и нажмите Enter.

Теперь можете его открыть и приступить к редактированию.

С использованием командной строки

Этот способ подойдет, если у вас не работает мышь, а встроенный блокнот не открывается.

  • Нажмите Win + R, введите cmd и нажмите Enter для запуска командной строки;

Источник: thecoderworld / Вызов командной строки

Источник: thecoderworld / Вызов командной строки

  • В командной строке введите команду `echo (текст) > ИмяФайла.txt` — указывать имя файла можно только латинскими буквами;

Источник: thecoderworld / Ввод команды в командную строку

Источник: thecoderworld / Ввод команды в командную строку

  • Нажмите Enter, чтобы файл появился в текущей директории.

Источник: thecoderworld / Результат в виде файла

Источник: thecoderworld / Результат в виде файла

Обратите внимание, что вы заранее должны перейти в нужную директорию или перед названием файла указать полный путь, например, «D:\new.txt»

Через текстовый редактор

Еще один удобный способ, если у вас установлено любое приложение для работы с текстом.

  • Откройте любой текстовый редактор, например, WordPad или Microsoft Word;

  • Напишите текст;

Источник: HOWZA / Сохранение файлов в формате TXT

Источник: HOWZA / Сохранение файлов в формате TXT

  • Выберите «Файл» > «Сохранить как…»;

  • В поле «Тип файла» выберите TXT (текстовый файл) и сохраните документ.

В некоторых случаях эта опция может находиться во вкладке «Экспорт».

Как создать текстовый документ на смартфоне

  • Откройте приложение для заметок (например, Google Keep или «Заметки» на iPhone);

  • Создайте новую запись и введите текст;

Источник: CQ / Создание файлов TXT на смартфоне

Источник: CQ / Создание файлов TXT на смартфоне

  • Сохраните или экспортируйте документ в формате TXT через пункт «Поделиться» > «Сохранить в Файлы»;

  • Теперь можете перейти в приложение «Файлы» и поделиться своим текстовым документом или отредактировать его.

Альтернативный способ: используйте файловые менеджеры, такие как Total Commander, чтобы вручную создать файл.

Заглавное фото: Microsoft

Читайте также:

  • Как создать свой язык в Telegram на Android
  • Как создать email на iPhone или Android
  • Как создать точку восстановления Windows 10 и 11
  • Как создать папку без названия в Windows
  • Как создать учетную запись Microsoft

Creating a text file on Windows 10 is a simple task that can be accomplished in just a few steps. First, open the File Explorer and navigate to the location where you’d like to create the file. Next, right-click in the folder, select “New,” and choose “Text Document” from the drop-down menu. Finally, name your text file and press Enter. Congratulations! You’ve just created a text file that’s ready for you to edit and save.

Creating a text file on Windows 10 is quick and straightforward. These steps will guide you through the process of creating a new text document, which you can use to jot down notes, write code, or save any text-based information.

Step 1: Open File Explorer

Open File Explorer by clicking the folder icon in the taskbar or pressing Windows + E on your keyboard.

Once File Explorer is open, you can navigate through your computer’s folders and drives. It’s your gateway to accessing and organizing files and folders on your system.

Step 2: Navigate to the Desired Folder

Navigate to the folder where you want to create the new text file. You can do this by clicking through the folders in the left pane of File Explorer.

Choosing the right folder ensures you keep your files organized. Whether it’s your Documents folder or a special project folder, having a designated spot for your text files can save you time later.

Step 3: Right-click in the Folder

Right-click in the blank space of the folder window to open a context menu.

The right-click menu is packed with options. It’s like a Swiss Army knife, offering tools and shortcuts to streamline your tasks.

Step 4: Select “New” and Then “Text Document”

Hover over “New” in the context menu, then select “Text Document” from the sub-menu.

This action tells your computer you want to create something new. By selecting “Text Document,” you initiate the creation of a blank text file based on the Notepad application.

Step 5: Name Your Text File

Once the text document appears, type in your desired file name and press Enter.

Naming your file is crucial for identifying it later. Pick a name that reflects the file’s content or purpose, making it easier to find when you need it again.

After completing these steps, your new text file will be ready for you to open and begin typing away in Notepad. It’s a blank slate, waiting for your words, thoughts, and creativity.

Tips for Making a Text File on Windows 10

  • You can also create a text file directly from the desktop by right-clicking on the desktop itself and following similar steps.
  • Use meaningful names for your text files to keep your files organized and easy to find.
  • Text files created with this method use the “.txt” extension, which is universally recognized.
  • Consider pinning frequently used folders to Quick Access for faster navigation in File Explorer.
  • Use Notepad++ or another advanced text editor if you need more features like syntax highlighting or plugins.

Frequently Asked Questions

What is a text file?

A text file is a simple file that contains text. It doesn’t have any special formatting or features like Word documents; it’s just plain text.

Can I create a text file without using File Explorer?

Yes, you can use command prompt (cmd) or PowerShell to create text files with commands, but File Explorer is the most user-friendly method.

How do I open my text file once it’s created?

Double-click the text file to open it in Notepad, the default text editor.

Can I convert a text file to another format?

Yes, you can open the text file in a word processor like Word and save it in a different format, such as .docx or .pdf.

Is there a size limit for text files?

Technically, text files can be very large, but performance may be slow with extremely large files. It’s best to keep them manageable in size for easy editing and opening.

Summary

  1. Open File Explorer.
  2. Navigate to the desired folder.
  3. Right-click in the folder.
  4. Select “New” and then “Text Document.”
  5. Name your text file.

Conclusion

Creating a text file on Windows 10 is as easy as pie, and it’s something that can be done in just a few clicks. Whether you’re writing a grocery list, jotting down important notes, or coding a new program, text files are your trusty sidekick. They’re lightweight, universal, and easy to create. As you get more comfortable navigating Windows, you’ll find new ways to utilize text files, making them an indispensable part of your digital toolkit.

Remember, staying organized is key. Use meaningful file names and keep track of where you save your files. Also, don’t be afraid to explore more advanced text editors if you’re diving into more complex tasks. Notepad is great for simple needs, but if you’re looking to code or need more features, tools like Notepad++ can be a great help.

At the end of the day, whether you’re a seasoned techie or a curious beginner, creating a text file is a fundamental skill that opens doors to many other possibilities in the vast world of computing. Happy typing!

Matt Jacobs has been working as an IT consultant for small businesses since receiving his Master’s degree in 2003. While he still does some consulting work, his primary focus now is on creating technology support content for SupportYourTech.com.

His work can be found on many websites and focuses on topics such as Microsoft Office, Apple devices, Android devices, Photoshop, and more.

Содержание

  1. Create file from command line
  2. To create file using echo
  3. To create file using fsutil
  4. Limitations
  5. How to Quickly Create a New, Blank Text File on Windows, Mac, and Linux
  6. Windows 10
  7. Use an Automator App to Create a New Blank Document in Any Folder on a Mac
  8. Use Terminal to Create a New Blank Document in Any Folder on a Mac
  9. Linux
  10. Use the Command Line to Create a New Blank Text Document in Linux
  11. Add a Blank Document Template to Nautilus in Ubuntu Linux
  12. Use the New Blank Document Template to Create a New Text File in Linux
  13. Save Time When Creating Text Files
  14. How to Create a Text File on Windows 10 (Create, Edit & Save)
  15. What is a text file?
  16. Creating a text file
  17. How to edit the text file
  18. How to create a text file using Notepad
  19. Conclusion
  20. Creating a TXT file
  21. What is a Plain Text format (.txt) File?
  22. How to Create a text (.txt) File?
  23. Ms Windows: Notepad
  24. Mac: TextEdit
  25. Ubuntu: gEdit
  26. Adam the Automator
  27. How to Create a Text File on the Command Prompt in Windows
  28. Nick Rimmer
  29. Prerequisites
  30. Creating a File with the Windows Command Prompt
  31. Using the ECHO Command
  32. Using the COPY CON Command
  33. Using the FSUTIL Command
  34. Creating a File with PowerShell
  35. Using the New-Item Cmdlet
  36. Using the Set-Content and Add-Content Cmdlets
  37. Using the Out-File Cmdlet
  38. Conclusion

Create file from command line

We can create files from command line in two ways. The first way is to use fsutil command and the other way is to use echo command. If you want to write any specific data in the file then use echo command. If you are not bothered about the data in the file but just want to create a file of some specific size then you can use fsutil command.

To create file using echo

To create file using fsutil

Limitations

Fsutil can be used only by administrators. For non-admin users it throws up below error.

Thank you for the quick and dirty method since windows seems to lack the “touch” command.

How can we use these commands to ‘touch’ a file. Could anyone provide the exact command that can work as linux ‘touch’ for any type of file?

Windows does not lack “touch”. It is echo. As the post describes? type: echo “” Blah.cpp

dude, this isnt working on our school’s computers, can you tell another method that works on windows 8 computers please?

lmao it works at school PC

Make sure that you are typing in the code the right way. It happened to me when I typed in “echo This is a sample text file sample.txt”.

If you want to create a file with NO text in it do this:
at the CLI type “Echo.”: Your output should look like this:
C:Temp>echo.

To write to a file:
C:Temp> Echo. >test.txt

This will create a file with single space in the file.

Источник

How to Quickly Create a New, Blank Text File on Windows, Mac, and Linux

productivity feature

Do you create a lot of text files? Learn how to quickly create a new, blank text file in Windows, Mac, and Linux.

Text files are useful for all kinds of things. Jot down a quick note, store information, and keep a log or journal are just a few of the things you can do with text files.

Today we’ll show you how to quickly create a new, blank text file in Windows, Mac, and Linux. In Windows, it’s easy. But on Mac and Linux, it requires some initial setup, then creating a new text file is quick and easy.

Windows 10

Microsoft provides a way of creating a new, blank text file using the right-click menu in File Explorer.

Open File Explorer and navigate to the folder where you want to create the text file. Right-click in the folder and go to New > Text Document.

01 Go to New Text Document Windows

Text Document in Windows File Explorer» width=»670″ height=»484″ data-srcset=»https://www.groovypost.com/wp-content/uploads/2018/05/01-Go-to-New-Text-Document-Windows.png 670w, https://www.groovypost.com/wp-content/uploads/2018/05/01-Go-to-New-Text-Document-Windows-640×462.png 640w, https://www.groovypost.com/wp-content/uploads/2018/05/01-Go-to-New-Text-Document-Windows-300×217.png 300w» data-sizes=»(max-width: 670px) 100vw, 670px»/>

The text file is given a default name, New Text Document.txt, but the file name is highlighted. Type a new name for the file and press Enter. Or just press Enter to accept the default name.

02 Rename new text document

There’s no built-in equivalent for Windows’ New > Text Document option on the Mac. But we can create a one-click option in Finder using the built-in Automator app.

Another option is to use a simple command in a Terminal window.

Use an Automator App to Create a New Blank Document in Any Folder on a Mac

Automator is a handy automation tool included in macOS. We’ve covered the basics of using Automator, but today we’ll go over how to use it to add an option for creating a new text file in Finder.

Launch Automator from the Applications folder. On the dialog box that displays, choose a location for the app you’re going to create. You can save it in the Applications folder. But if you’d rather not store it there, you can choose another location. Just make sure it’s a permanent location.

Once you’re in the chosen location, click New Document.

03 Click New Document

Automator asks what type of document you want to create. Click Application in the Choose a type for your document box. Then, click Choose.

04 Choose Application type

Make sure Actions is selected above the far-left pane and Library is selected in the pane. Scroll down in the list of actions and drag the Run AppleScript action to the workflow pane.

05 Drag Run Applescript to workflow panel

Delete the text currently in the Run AppleScript box. Copy the following line and paste it into the Run AppleScript box.

Then, go to File > Save.

06 Paste script and Save

Enter a name for the app in the Save As box, keeping the “.app” extension.

Make sure Application is selected for File Format. This should be the default choice. Then, click Save.

07 Save app

Now that we’ve created our Automator app, we will add it to the toolbar in Finder.

Open Finder and go to the folder where you saved the Automator app.

Hold down the Option and Cmd keys and drag the app file to the toolbar.

08 Drag app to Finder toolbar

To use your new app to create a blank text file, go to the folder where you want to store the file and click the Automator button on the toolbar.

A text file called “untitled” is created in the folder.

This method of creating a blank text file does not put the “.txt” file extension on the file. If you’re planning on transferring that file to a Windows machine, you should add the “.txt” file extension to the file. It’s harder to work with files that don’t have extensions in Windows.

09 Untitled text document created

To add the “.txt” file extension, and change the file name, if you want, right-click on the text file. Then, select Rename and type a new name for the file, making sure to type: .txt at the end of the file name.

Click Add when the following dialog box displays.

10 Add extension confirmation dialog

Double-click the new text file to open it in your default text editor, add content to it, and save it.

11 Text file open in

Use Terminal to Create a New Blank Document in Any Folder on a Mac

You can also use the Terminal to create a new, blank text file. The easiest way is to open Finder and select the folder to save the text file. Go to Finder > Services > New Terminal at Folder.

12 Select New Terminal at Folder

A Terminal window opens to the selected folder. Type the following command at the prompt, replacing “MyTextFile.txt” with the name you want to use for your text file.

The file is created and saved in your chosen folder. You can double-click on the file to open it in your default text editor, add content, and save it.

13 Text file created using Terminal

Linux

In Linux, you can use the command line to create a new, blank text file, in the same way you do on the Mac. If you prefer using Nautilus to deal with files, you can quickly create text files there also.

Use the Command Line to Create a New Blank Text Document in Linux

To use the command line to create a new, blank text file, press Ctrl + Alt + T to open a Terminal window. Type the following command and press Enter.

Change the path and the file name (

/Documents/TextFiles/MyTextFile.txt) to what you want to use. The tilde character (

) is a shortcut for your home directory. For example, the full path to my text file above is /home/lori/Documents/TextFiles/MyTextFile.txt.

This method works in any Linux distribution, but the shortcut key to open a Terminal window might differ.

14 Use touch command on

Add a Blank Document Template to Nautilus in Ubuntu Linux

We will cover how to add an option to Nautilus in Ubuntu to create a new text file. File managers in other distributions of Linux, like Linux Mint, Fedora, Red Hat, etc., may already have this option. If not, you can use the command line method mentioned above.

Before Ubuntu 17.10, Nautilus contained an option on the right-click menu that allowed you to create a new, blank document in the current folder. But that option was removed in 17.10 and 18.04. We’ll show you how to add the option back to Nautilus.

In your “Home” directory, you’ll see a folder called Templates. Initially, it’s empty. Adding files to this folder allows you to quickly create new files using the right-click menu in Nautilus.

15 Templates folder in Nautilus

You can use the touch command we discussed in the previous section to create a new blank document template file.

Press Ctrl + Alt + T to open a Terminal window. Then, type the following command and press Enter.

That’s a backslash and a space between “Empty” and “Document.” If there’s a space in your path or file name, you must put a backslash before it.

A new file called “Empty Document” is added to your Templates directory. You can use a different name for the template file but save it in the Templates directory.

If you’re not comfortable with the command line, you can create the blank document template using gedit. Hit the Windows key and type: gedit in the search box. Then, click the Text Editor icon that displays.

16 Search for gedit

Click Save without entering any text in the file.

17 Click Save in gedit

Go to the Templates directory in your Home directory.

Enter a name, like “Empty Document,” in the Name box and click Save.

18 Save Empty Document in Templates folder

Use the New Blank Document Template to Create a New Text File in Linux

Once you’ve created a blank document template using the steps in the previous section, you can now create a new text file in Nautilus.

Right-click in any directory and go to New Document > Empty Document. The Empty Document option shows whatever you named your template file so that the option may be different for you.

19 Create empty document in Nautilus

Save Time When Creating Text Files

Of course, you can always use a text editor to create a new text file. But the methods we showed you here are handy if you create a lot of text files.

Источник

How to Create a Text File on Windows 10 (Create, Edit & Save)

This could be one of the most universally needed features across any operating system or platform. Knowing how to create a text file on Windows 10 is a skill that you will be using all throughout your lifetime of using technology.

Windows has a great inbuilt feature for you to quickly and easily create and edit a text file and save it anywhere you like.

You don’t have to spend any money on extra software to get the job done effectively and easily.

The built-in text Notepad editor is not as sophisticated as a complete word processor but still provides you with more than enough features to get the job done.

What is a text file?

Other than that, it contains basic plain text. Special characters can be present within one or even ASCII characters. Anything more like images won’t be part of it.

Creating a text file

If you made a mistake, you can easily rename it again, or delete it and start over.

Info Nibble: If you are halfway editing the filename (and still in the editing mode) and don’t want to make the changes anymore, press the ‘Esc’ key on your keyboard.

How to edit the text file

Simply move your mouse pointer onto the text file and double-click your left mouse button.

The Windows Notepad text editor will open it for editing.

Once you have edited it, you can click on ‘File’ and ‘Save’ in order to update it.

How to create a text file using Notepad

By opening the Notepad text editor directly, you can begin creating and editing your file straight after the program has been opened.

This may seem easier for some, so this method would be the preferred way in that case.

To open Notepad simply press the Windows key and start typing notepad. You will most likely have typed a few characters and Notepad will appear in the menu for you to select.

Press your left mouse button while hovering your mouse pointer over Notepad in the menu.

Once Notepad has been opened, edit your document and left-click your mouse on ‘File’ then left-click on ‘Save As’ to create it and select its save location.

Conclusion

If you are wanting a lightweight yet slightly more sophisticated text editor that also can be formatted for other applications, I highly recommend Notepad++. It is free and lightweight.

However, if your needs are limited, I’d recommend sticking to Notepad.

Text files can be saved on mobile devices, cloud storage facilities, USB flash drives, tablets, and computers to name a few examples.

They can be viewed and edited by such a large variety of devices and software.

This makes them the perfect go-to for storing quick notes or information you need to refer back to at any time.

So, knowing how to create a text file is a very useful skill, wouldn’t you agree?

Источник

Creating a TXT file

Plain text is a public, standardized, and universally readable document and file format. That’s why we selected this format for our interactive e-mail validation thru DeBounce dashboard! Using plain text instead of bit-streams to explicit markup makes them in large part resistant to system architecture incompatibilities.

Earlier than uploading the file containing the e-mail addresses, you or your sub-accounts simply need to comply with these commands:

What is a Plain Text format (.txt) File?

TXT is a file extension for a text file, used by a variety of text editors. Text is a human-readable sequence of characters and the words they form that can be encoded into computer-readable formats. There is no standard definition of a text file, though there are several common formats, including ASCII (a cross-platform format), and ANSI (used on DOS and Windows platforms).

How to Create a text (.txt) File?

You can create a text file on your computer with a text editor. An example of a text editor is Notepad, which is included with Microsoft Windows. The following section includes instructions for three of the most used ones – Windows, MacOS and Ubuntu.

Ms Windows: Notepad

The easiest way to create a text file in Windows is to open up the Notepad software program on your computer. The Notepad is a text editor included with Microsoft Windows. The Windows Notepad program can be found by following either of the steps below:

Mac: TextEdit

TextEdit is an application on every Mac that you can use to create and edit text files. It’s included with all versions of macOS and OS X. Find TextEdit in the Applications folder on your Mac computer. By default, it creates formatted documents saved in rich text format, but you can use it to create a plain text file on a Mac. To do so, launch the program, click the “Format” menu and select “Make Plain Text.” Use the “Open” command in the “File” menu to find, open and edit existing text documents.

Ubuntu: gEdit

gEdit is a Linux text editor commonly deployed as part of the GNOME desktop environment. If it is not included in your Ubuntu system, you can install this software by either selecting gedit in Synaptic (System → Administration → Synaptic Package Manager) or by typing the following command on your Terminal (or ALT+F2):

Источник

Adam the Automator

How to Create a Text File on the Command Prompt in Windows

Nick Rimmer

Read more posts by this author.

To create a file in Windows, right-click on your desktop or in File Explorer and click on New. Is this post going to be the shortest post ever? Nope. Because using the GUI sometimes won’t work, you can use the command prompt to create a file.

In this tutorial, you will learn just about every way possible to create a file on the command line, such as using the Windows command prompt and PowerShell!

Prerequisites

If you’d like to follow along with the steps in this tutorial, be sure you have the following ahead of time:

Creating a File with the Windows Command Prompt

You have two command-line options in Windows; the command prompt (cmd.exe) or PowerShell. Let’s first cover how to use the Windows command prompt to create a blank file.

To get started, open the Windows command prompt by clicking on the Start button, typing cmd.exe, and hitting Enter. The Windows command prompt should come up, and you’re ready to go.

Using the ECHO Command

Let’s start this tutorial by first covering the echo command. The echo command is a command-line utility that allows you to display messages in a command prompt. In Windows, if you can send something to the command console, you can also redirect that output to a file!

In the Windows Command Prompt window:

1. Run the echo command as shown below. This command echoes the text provided ( This is a sample text file ) to the command console. But, since the command is using the redirection operator ( > ), this operator tells Windows to instead create a file with the text ( sample.txt ).

When you’ve created the file, run the dir command to list all files in the current working directory

You can see below that Windows creates the sample.txt file in the current working directory.

2. To confirm the file contains the expected “This is a sample text file” text, execute the type command followed by the file name. The type command reads the file and returns the text inside.

You can see below that sample.txt does, indeed, contain the expected text.

Using the COPY CON Command

If the echo command doesn’t fit your taste, you can always use the copy command using the con argument. Instead of copying files, the con argument tells the copy command to copy output to the console.

The con argument is actually a device, not a command.

To create a file using copy con :

1. Run copy con followed by a file name. This command won’t immediately create the file. You’ll be presented with a flashing cursor.

2. Once you see that flashing cursor type in some text you’d like to include in the file and press Enter.

When you’re done, press Ctrl-Z and press Enter to exit the interactive prompt. Pressing Ctrl-Z will also add an end-of-file marker to tell Windows to close the open file handle.

Using the FSUTIL Command

For the next Windows command prompt utility, introducing fsutil! Fsutil is a file system management tool built into Windows.

To use fsutil on the command prompt to create a new file:

1. Close the command prompt if you still have it open and open it up again, but this time as an administrator. Unfortunately, the fsutil utility requires it.

2. Now, invoke the file function of fsutil to create a new file using the createnew argument followed by the file name to create ( sample.txt ) and the size in bytes you’d like the file to be ( 1000 ).

The below command will create a file called sample.txt in the current working directory that’s 1KB in size.

3. Type dir again to list all files in the current working directory and you should see a 1,000-byte file now exists.

Since the fsutil utility can create blank files of a certain size, the utility is great for creating dummy files for network performance testing!

Creating a File with PowerShell

It’s now time to use a more modern approach of using a Windows command prompt to create a file; with PowerShell! PowerShell has a few different ways to create a file so let’s cover them all.

So, open your Windows PowerShell or PowerShell console and let’s get started!

Using the New-Item Cmdlet

One of the easiest ways to create a file in Windows with PowerShell is to use the New-Item cmdlet This cmdlet creates new items (a file in this case).

The New-Item cmdlet can also create Windows registry keys or folders.

1. Run the New-Item cmdlet specifying the directory to create the file in ( Path ), the Name of the file, the type of item ( ItemType ), and finally, the text to include in the file ( Value ).

You can also use New-Item to create a directory by using the Directory argument for the ItemType parameter.

2. Now, take a look at the file just created using the Get-Content cmdlet to tell PowerShell to read the file and display its contents.

Using the Set-Content and Add-Content Cmdlets

Next, let’s check out the Set-Content and Add-Content PowerShell cmdlets. These two cmdlets can create files in a similar fashion but Set-Content creates and overwrites a file while Add-Content will create and append to an existing file.

With PowerShell still open, run the Set-Content cmdlet providing it the Path and name of the file to create with the text you’d like the file to contain ( Value ) as shown below.

The command below will create a file called sample.txt in the current working directory with the text This is a text string inside the file.

Using the Out-File Cmdlet

To round out how to create a file on the command prompt with PowerShell, let’s end this tutorial with the Out-File cmdlet.

The Out-File cmdlet is a handy command similar to the redirection operator ( > ) previously covered in the Windows Command Prompt section. The Out-File cmdlet accepts input from the PowerShell console and writes that output to a file of your choosing.

With PowerShell still open, type some text ( «This is a test» ) and pipe that text to the Out-File cmdlet providing the path to the file to create ( FilePath ).

The below command will create a file called sample.txt in the current working directory with the text This is a test inside.

You can see below that PowerShell created a 16-byte file called sample.txt.

Conclusion

This tutorial has covered six different ways you can create files from the command prompt using both the Windows command prompt and PowerShell. By now, you should know just about all the ways to create text files on the command line.

Which method do you prefer?

More from Adam The Automator & Friends

Expose REST APIs, schedule jobs, and provide custom user interfaces with the platform built for PowerShell to integrate with anything.

We’ve put together a list of the resources we, at ATA, can wholeheartedly recommend!

Why not write on a platform with an existing audience and share your knowledge with the world?

Источник

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Windows 365 sign in
  • Download the windows pe add on for the adk
  • Как посмотреть версию python windows
  • Как установить windows на материнке msi
  • Nv container class windows