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
96 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-...
user avatar
  • 297
0 votes
1 answer
24 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 ...
user avatar
1 vote
0 answers
27 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 ...
user avatar
-3 votes
1 answer
61 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 ...
user avatar
0 votes
0 answers
28 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 ...
user avatar
0 votes
1 answer
32 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 ...
user avatar
  • 19
0 votes
1 answer
40 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)....
user avatar
0 votes
2 answers
65 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 ...
user avatar
0 votes
3 answers
55 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 ...
user avatar
  • 129
2 votes
5 answers
400 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 ...
user avatar
  • 25
0 votes
0 answers
345 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 ...
user avatar
1 vote
3 answers
54 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 }; {...
user avatar
  • 297
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 ...
user avatar
7 votes
6 answers
816 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 ...
user avatar
  • 297
3 votes
3 answers
243 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 ...
user avatar
  • 297
0 votes
2 answers
241 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 ...
user avatar
  • 297
0 votes
1 answer
17 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).
user avatar
  • 283
1 vote
1 answer
44 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 ...
user avatar
  • 968
0 votes
1 answer
87 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
user avatar
2 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. ...
user avatar
  • 229
0 votes
0 answers
46 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 ...
user avatar
  • 11
4 votes
2 answers
394 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 ...
user avatar
  • 71
0 votes
2 answers
70 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 |...
user avatar
  • 245
1 vote
0 answers
37 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 ...
user avatar
0 votes
0 answers
100 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: ...
user avatar
1 vote
2 answers
111 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 ...
user avatar
9 votes
3 answers
486 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 ...
user avatar
  • 333
-1 votes
4 answers
169 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 ...
user avatar
0 votes
1 answer
62 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 ...
user avatar
  • 295
2 votes
1 answer
406 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 ...
user avatar
  • 327
1 vote
1 answer
433 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 ...
user avatar
  • 1,151
0 votes
1 answer
37 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 ...
user avatar
-4 votes
2 answers
134 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 ...
user avatar
2 votes
3 answers
390 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 ...
user avatar
0 votes
1 answer
100 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 ...
user avatar
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 ...
user avatar
  • 47
0 votes
2 answers
69 views

How to change columns, drop inverted commas and add tabulation to a text file with bash

I'm quite new into bash and awk in bash scripting and from this text that I have in a file: "Index", "Year", "Age", "Name", "Movie" 1, 1928, 44, "...
user avatar
  • 101
1 vote
2 answers
74 views

name that has biggest number

I have a file with a list of names and a number next to it separated by a space for exemple: Mat 199 rose 150 I want to display the name that has the biggest number next to, so in this exemple, ...
user avatar
4 votes
1 answer
196 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 ...
user avatar
  • 4,750
0 votes
2 answers
213 views

How to fix linux text files with no newline or EOF?

I need to write a "find" exec command to awk print formatted results to some existing text files. In some odd scenario, I would get lines appended on the previous last line (no CR after LF?),...
user avatar
0 votes
1 answer
29 views

How to check where there is a special function under a directory

in the directory /data/repo/, there are many .php files. I want to know whether in the files there is eval() function. how can I check ? because I want to check whether there is One word Trojan under ...
user avatar
  • 613
1 vote
1 answer
28 views

need help with my menu program

i'm having issue with the script, the selection 2 and 3 doesn't show anything when executing. #!/bin/bash while true do clear echo "========================" echo "Menu ----"...
user avatar
  • 11
-1 votes
2 answers
52 views

Remove certain pattern in text file

I've got a text file of the form id="111"ABC id="222"DEF id="333"GHJ where the count of numbers within "" varies as well as the numbers vary. Furthermore, ABC, ...
user avatar
  • 23
3 votes
3 answers
201 views

Adding/inserting different texts to specific intervals of same text file?

I know how to insert a single text to specific interval. But now my problem is, I want to insert different texts/words saved in an add.txt file to a specific intervals of another data.txt file. I want ...
user avatar
2 votes
1 answer
270 views

extract 5 first lines of a text file to a variable

I'm wondering if it's possible to "extract" the first 5 lines of a textfile to a single variable (not an array) for example: head -5 test.txt >$variable (which of course doesn't work) I'm ...
user avatar
  • 327
4 votes
2 answers
616 views

How to grep for a specific word and grab text

I have a text file which lists a hostname and in the line directly under states the results of a ping of a salt minion. Here is an example output: T5F6Z12: Minion did not return. [Not connected] I ...
user avatar
0 votes
1 answer
51 views

Navigating Text...Is there a way to go back and/or forward N characters or jump to next/previous non-alphanumeric character?

I'm talking in terms of keyboard navigation shortcuts, that would apply to any text box/editor/etc...Sometimes I'd like to just have a faster means of jumping to a particular location in a string, but ...
user avatar
-1 votes
1 answer
52 views

Wordlist generation in ubuntu with static first characters

So,I wanted to ask what the easiest way is to generate a wordlist of the following: Sample:/16.04.20/A22006 Sample:/16.04.20/A22029 Sample:/16.04.20/A22052 The number following A is increasing with ...
user avatar
  • 1
0 votes
1 answer
421 views

How to convert all text files in directory to one csv

I want to convert all text files in a directory to one csv file. I want the input to the csv to be the text in the text file labeled by the author of the text file found in the filename. For reference,...
user avatar
  • 35
11 votes
1 answer
980 views

Why does this grep statement do the opposite of what I expect?

I have a file with some HTML and some text mixed in, I just wanted to use the text lines. I was fooling around with grep, trying to get a way to exclude the lines that began with an HTML tag, even ...
user avatar

1
2 3 4 5
7