Questions tagged [text]

text intended for human readers, generally consisting of sentences in a human language organized in paragraphs

This tag is about manipulating text intended for human readers, generally consisting of sentences in a human language organized in paragraphs.

For the processing of data organized as a sequence of lines, see .

349 questions
193
votes
7 answers

Creating diagrams in ASCII

I am looking for a program which I can use to create ASCII diagrams such these: +---------+ | | +--------------+ | NFS |--+ | | | | | +-->| …
Martin Vegter
  • 69
  • 66
  • 195
  • 326
83
votes
4 answers

What is the purpose of -e in sed command?

I can't find any documentation about the sed -e switch, for simple replace, do I need it? e.g. sed 's/foo/bar/' VS sed -e 's/foo/bar/'
Howard
  • 977
  • 2
  • 7
  • 5
66
votes
4 answers

What is the ^M character called?

TexPad is creating it. I know that it is under some deadkey. I just cannot remember it is name. The blue character: I just want to mass remove them from my document. How can you type it?
Léo Léopold Hertz 준영
  • 6,788
  • 29
  • 91
  • 193
57
votes
10 answers

Finding all "Non-Binary" files

Is it possible to use the find command to find all the "non-binary" files in a directory? Here's the problem I'm trying to solve. I've received an archive of files from a windows user. This archive contains source code and image files. Our build…
Alana Storm
  • 1,413
  • 3
  • 14
  • 17
53
votes
5 answers

How can I find out how many lines a text file contains without viewing it?

How can I find how many lines a text file contains without opening the file in an editor or a viewer application? Is there a handy Unix console command to see the number?
Ivan
  • 17,368
  • 35
  • 93
  • 118
51
votes
10 answers

Is there a convenient way to classify files as "binary" or "text"?

Standard Unix utilities like grep and diff use some heuristic to classify files as "text" or "binary". (E.g. grep's output may include lines like Binary file frobozz matches.) Is there a convenient test one can apply in a zsh script to perform a…
kjo
  • 14,779
  • 25
  • 69
  • 109
42
votes
5 answers

creating a sequence of numbers, one per line in a file

Is there a way to create out of thin air, a file that is a sequence of numbers, starting at a given number, one per line? something like magic_command start 100 lines 5 > b.txt and then, b.txt would be 100 101 102 103 104
Duck
  • 4,434
  • 19
  • 51
  • 64
41
votes
4 answers

Does vi silently add a newline (LF) at the end of file?

I have trouble understanding a weird behavior: vi seems to add a newline (ASCII: LF, as it is a Unix (AIX) system) at the end of the file, when I did NOT specifically type it. I edit the file as such in vi (taking care to not input a newline at the…
Olivier Dulac
  • 5,924
  • 1
  • 23
  • 35
41
votes
5 answers

Converting a UTF-8 file to ASCII (best-effort)

I have a file in UTF-8 that contains texts in multiple languages. A lot of it are people's names. I need to convert it to ASCII and I need the result to look as decent as possible. There are many ways how to approach converting from a wider encoding…
user7610
  • 1,878
  • 2
  • 18
  • 22
40
votes
4 answers

Is there some sort of PDF-to-text converter?

I need PDF files in text so I can search over them in bulk from commandline. Is there some converter for Ubuntu, OBSD or similar distro? Perhaps related post, OCR with Ubuntu here.
otto
  • 501
  • 1
  • 4
  • 3
40
votes
4 answers

How to change encoding from Non-ISO extended-ASCII text, with CRLF line terminators to UTF-8?

I have a txt file : $ file -i x.txt x.txt: text/plain; charset=unknown-8bit $ file x.txt x.txt: Non-ISO extended-ASCII text, with CRLF line terminators And there are some characters that are incorrectly encoded : trwa³y, sta³y, usuwaæ How can…
Patryk
  • 13,556
  • 22
  • 53
  • 61
33
votes
2 answers

What conditions must be met for a file to be a text file as defined by POSIX?

POSIX defines a text file as: A file that contains characters organized into zero or more lines. The lines do not contain NUL characters and none can exceed {LINE_MAX} bytes in length, including the character. Although POSIX.1-2017 does…
Harold Fischer
  • 1,914
  • 1
  • 16
  • 29
30
votes
6 answers

Open a text file in a terminal and auto-refresh it whenever it is changed

How do I open a text file in a terminal with instant auto-refresh every time it is changed? I've looked at vim with :set autoread, but it requires some elementary input (such as a keypress inside vim) to trigger the refresh. I want the auto-refresh…
Kit
  • 1,023
  • 3
  • 10
  • 13
28
votes
9 answers

Is there something like a lorem ipsum generator?

Is there something like a 'lorem ipsum generator'? I know it exists in Latex, and even in LibreOffice, but I'm looking for a terminal command. I would like to type something like loremipsum 10 >> file1.txt that would give me the first 10 paragraphs…
Frank
  • 383
  • 1
  • 3
  • 6
24
votes
6 answers

Which extension to use for text files? (Unix/Linux)

I noticed that I can read text files without an extension .txt just fine. How come? Should I save these files with or without the .txt extension? Also, what about .ini files? I usually use them like this: config.ini, should I remove the extension…
jcora
  • 3,874
  • 7
  • 34
  • 52
1
2 3
23 24