Questions tagged [text]

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

Filter by
Sorted by
Tagged with
2 votes
2 answers
161 views

Indent lines of text following given rule

I was wondering how indenting recursively more and more lines of poetry following a custom rule. For instance Let say we have: OF Mans First Disobedience, and the Fruit Of that Forbidden Tree, whose ...
0 votes
2 answers
50 views

Extract fields from JSON document embedded in text file

I have the following line of text, and I would need to extract a few of the fields from the JSON part of the line of text. June 27th 1997, 10:11:52.621 {"serviceId":"00034","...
1 vote
2 answers
33 views

What program is best for outputting an image with my inputted text on it?

I'm looking for a program that is able to output an image with my inputted text on it. Sort of like a template, I would input varying text / numbers and an image, and the program will output the image ...
2 votes
2 answers
151 views

replacement for tr with utf-8 capabilities

in order to isolate the last word in any line of a poem (to have a list of all rhymes), I put together several snippets of code obtaining this awk '{print $NF}' input.txt | tr 'A-Z' 'a-z' | tr -sc 'a-...
0 votes
1 answer
31 views

Replace text in terminal

I am using secure copy to copy some data from a server to a folder (let's say: scp name@server.com:/project1/data/ data1/). My question is if it is possible to save the address of the server (in the ...
1 vote
0 answers
31 views

How to find the PHP file which prints an HTML element with a certain selector?

I store my MediaWiki 1.36.1 website with Skin:Timeless on NameCheap with a shared hosting environment with Cpanel file manager and SSH shell access. In my website, there is a certain footer element ...
0 votes
1 answer
1k views

how to compare text file datas with excel sheet values

For Example : in my username.txt file ravi peri perl phython in my .xls file i have two columns named as user name and email username email ravi ravi@...
-3 votes
1 answer
78 views

How to copy text from text editor to tty command line

Using debian 11 GNU/linux bullseye without mouse, only keyboard. The problem: I have a file with a password, very long and complicated. I need to copy it and paste when I login via ssh. I tried to ...
0 votes
0 answers
31 views

How to replace text in file - conditions and arithmetic required

I need a script to change content in some text files. This a bit beyond my limited bash skills. Maybe perl or python would be a better approach, I have no experience with either of these. I have a ...
0 votes
1 answer
42 views

Add value to a string

I have a large bash file that has a lot of lines like this: ... --env COMP_LABELS="service:service1" ... Where service1 differs in every line. (sometimes it's service:mgmt or service:admin)....
0 votes
1 answer
46 views

Create multiple file from single txt file

I have a single input file that needs to be replicated multiple times with a little change in every file i.e every 30th line in every file is to change. For e.g. My main text file name is D0.txt which ...
1 vote
0 answers
38 views

In Less, how to jump horizontally between search matches on the same line?

On pressing n, Less skips all the search matches in the current line and moves to the next line with a match (even if the lines are wrapped). How can I make it move the cursor to all the matches in ...
0 votes
2 answers
80 views

Append the name of each text file to the last line of the file [closed]

I have ten files: firstFile.txt,...,tenthFile.txt On the last line of the file I would like to append the name of the file. i.e. for the first one the last line would be "firstFile" I would ...
1 vote
1 answer
47 views

`kate -n new.txt %u` in Dolphin service menu saves one level up

When creating a new Dolphin service menu to create a new text file using Kate (given there is no shortcut for that like for folders and that the menu option is rather hidden under multiple clicks as ...
0 votes
3 answers
64 views

How to sort a file contents after n lines?

In linux we can run sort command to sort file contents, but in my case I have the following file (THANKS.txt): These people have contributed to OSN Envoy. We always try to keep this list updated and ...
2 votes
5 answers
464 views

grep multiple lines from a text file

Does anybody know how to grep multiple lines from a text file? I googled many results, but still not fully working. Text file example: x x x --- start a b c d --- x x x And I want to get only this ...
0 votes
2 answers
271 views

Any text utility or hack to numbering poems lines omitting certain numbers?

My goal is try to see if there are common text utilities in linux that can be used to number lines of poems like this: OF Mans First Disobedience, and the Fruit Of that Forbidden Tree, whose mortal ...
1 vote
3 answers
57 views

Restarting poem line numbering any 4 lines after a blank space

This is related to very interesting answer given here: Any text utility or hack to numbering poems lines omitting certain numbers? awk 'FNR % 4 == 0 { printf "%6i %s\n", FNR, $0 ; next }; {...
0 votes
0 answers
650 views

Convert binary file to text file

I'm struggling with a srt subtitles, which are a binary file for some reason: file -i file.srt file.srt: application/octet-stream; charset=binary When opening them in kate (KDE text editor) they look ...
4 votes
1 answer
213 views

Text file with unknown header does not print propperly

I have a bunch of text-files that always come along with a backup file: file.TXT file.BAK the *.TXT file contains a header like this: .V3 PL=62 MB=1 MT=1 DR=TMTYM FL=0 FT=0 ...
7 votes
6 answers
831 views

Uppercasing first letter of a line after period in previous line

I have many little poems to edit like this: Io avevo due sorelle, una bionda e l’altra mora, tutte e due leggiadre e belle e gentil come l’aurora. ma la bionda mi è sparita, se ne è andata all’altra ...
1 vote
0 answers
16 views

how can I stop mint/mate before the mate environment loads

I have a mint 20 install with mate. I ran out of disk space on the boot device. I booted off an external medium, erased files and now have a residual issue with Mate. I had the system configured to ...
3 votes
3 answers
250 views

Numbering poems stanzas using roman numerals

I would be able to numbering, sequentially, any stanza of a certain poem using roman numerals like this: Injurious love, why still to mar accord Between desires has been thy ...
0 votes
1 answer
20 views

text/plain mimetype being set to "Python File (no console)"

After installing Wine and Python 2.7 in Wine, and then removing Wine, the plain text file format cannot be changed away from Python File (no console).
46 votes
10 answers
24k views

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 ...
3 votes
4 answers
1k views

Find all scripts with a given shebang line with find & sed

I want to find out all scripts with a specific shebang line. Specifically, I want all files that match the following criteria: It's mostly a plain text file (stuffs created by gzexe don't look very ...
0 votes
1 answer
38 views

Safe to remove Mousepad dependencies in POP_OS?

Note: Originally posted question on Ask Ubuntu and they kindly directed to this StackExchange as more appropriate for a non-official Ubuntu derivative. Background information. Currently Running ...
0 votes
1 answer
116 views

Add page break to text file for printing

How do I add a page break to a text file for printing with lpr? What about if I want to send two files to lpr but have each on their own page as in: cat file1 file2 | lpr
3 votes
1 answer
2k views

Using Kate text editor, how to compare two files and find differences

I am using Kate text editor, and I would like to compare two files, and find (highlight) their differences. Maybe there is a plugin to do that? I would be open to solutions other than using Kate, e.g. ...
0 votes
0 answers
47 views

echo each line from txt in in while

Hello im doing a simple script that i provide a list and the script response with the Location of the store. But i have problems in the response because i want this output echo "$stores ...
184 votes
7 answers
87k views

Creating diagrams in ASCII

I am looking for a program which I can use to create ASCII diagrams such these: +---------+ | | +--------------+ | NFS |--+ | ...
2 votes
1 answer
65 views

Index and search a directory

I have a directory tree containing many text-files. I would like to index the full-text of all these files (ignoring files with certain file-extensions), so that I can quickly search thorugh all of ...
4 votes
2 answers
504 views

Sort and remove duplicates in place and recursively

I would like to sort all files in all subdirectories in place. I have 65536 files in 256 directories, every file containing one word a line, and each file contains duplicates. What I would like is to ...
0 votes
2 answers
122 views

How to create a text file with path for a script and with directory names?

I have a directory named data. Inside data there is one directory samples which has more than 50 directories and there is one shell script testing.sh inside data. The setup looks like below: data |...
0 votes
0 answers
139 views

How to format text file to be readable in terminal

I thought this would be an easy question to find an answer to online, alas not. In a nut shell I want to be able to open a text file to be formatted to be nicely readable in the terminal. Background: ...
1 vote
2 answers
135 views

How to store .txt file data in different columns of a CSV file using BASH?

I have a .txt file with the following data structure: Scan Times: 33.3 seconds 77.4 seconds 33.3 seconds 77.4 seconds Check Times: 110.30 seconds 72.99 seconds 72.16 seconds 110.30 seconds ...
9 votes
3 answers
490 views

How to search for multiline text files containing a set of words (e.g., AAA & (BBB | CCC) & ~DD)?

I need to find the files that fulfill relatively complex condition. For example, I want to find all files that fulfill all below conditions: does contain word AAAA does contain word BBB or CCCCC (may ...
2 votes
3 answers
452 views

How to append the begining of a file with text from STDIN

I'm working to debug some kind of issue with the Nix Linux installer script on Debian-based OSs Like what was said here, this snippet of the /etc/bash.bashrc: # If not running interactively, don't do ...
-1 votes
4 answers
251 views

Script to add string before the first column of a file

I have the following file: ID firstname lastname 1 John Wilkens 2 Andrea Smith I would like to add in the ID field before the numbers the following ...
6 votes
2 answers
12k views

Possible to view two text files side by side (read only)?

In emacs, we can view two text files side by side. Is it also possible to do so in some simpler/lighter applications such as less? Only viewing, no editing.
17 votes
3 answers
6k views

md5sum command binary and text mode

The GNU md5sum command has two modes: binary mode and text mode. I guess the difference is only on how newline characters are handled? Am I right? On GNU/Linux, the two modes always produce same ...
0 votes
1 answer
64 views

Highlight every number that is smaller than all previous numbers in the last column

Input: network-snapshot-000000 time 6m 40s fid50k_full 34.9546 network-snapshot-000201 time 6m 52s fid50k_full 30.8073 network-snapshot-000403 time 6m 51s ...
2 votes
1 answer
526 views

Why am I seeing % as the line end when running cat file cmd [duplicate]

This really confused me, when I do a cat cmd, I always see something like % at the end of a file, but if I open the file on editor or sublime, it is gone. So how to make sure my file is in a correct ...
1 vote
1 answer
538 views

Convert EPUB to TXT and preserve original formatting

I have a programming book in EPUB format and I'm trying to convert it to TXT. For that I'm using the utility ebook-convert from calibre. The problem is that the standard usage: ebook-convert book.epub ...
-4 votes
2 answers
144 views

Editing text file via awk command

I am very newbie about on that command, so far I tried few things with that but I failed every time.. I have a text file (MWE) like below: 26 6 2020 09:06:23.300 277.430 50.131 ...
19 votes
5 answers
23k views

Keyboard Shortcut To Send Text Strings To Program

How can I configure a shortcut key to send a text string to the current program? The purpose is to type common entries quicker (email address, street address, phone number, username, favorite quote, ...
0 votes
1 answer
106 views

Why Windows text files encoding crash after I open them in Linux system?

I use Debian and sometimes I need to mount Windows disks because I want to read some *.txt file from Windows. Sometimes it's okay, but sometimes after I edit or read file using Debian system and then ...
0 votes
2 answers
313 views

What are some types of text files that shouldn't end with newlines?

This question and this question point out that generally the standard is to end text files with newline characters to meet the POSIX standard, and this is something expected with GNU tools and other ...
2 votes
4 answers
1k views

Bash, get links from pdf

Os ubuntu. Need to get links or more data (for example binding layer from QuarkXPress application) from pdf to text, in terminal. Tried pdftotext, but seems links are not exported, pdfgrep is the ...
0 votes
1 answer
25 views

How does many binaries changes the percent number of the execution in its right place?

I'm trying to write a C program which can do the thing that many binaries such as package managers do in execution time. They change and add to the already outputted texts in terminal and it makes it ...

1
2 3 4 5
7