Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [text]

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

3
votes
1answer
40 views

Is there a portable way to switch text case from the command line?

Is there a way, portable across POSIX operating systems and locale-aware, to switch text case from the command line--that is replacing lower case letters by upper case ones and vice versa. Using GNU ...
0
votes
1answer
29 views

Python script runs as bash command on terminal but not as a cron job

I am trying to run a python script on my Raspberry Pi (Stretch OS) as a cron job but the script fails to run fully. On crontab -e, it reads like this: */1 * * * * python /home/pi/project/myfile.py &...
0
votes
0answers
12 views

syslinux menu/label text

I want to add some "helper" or "group" text to my syslinux menu like in the screenshot. Im talking about the text "Installation" and "Tools" text after the "MENU SEPARATOR". How can i reach this goal?...
4
votes
3answers
236 views

Replacing two patterns in a text files at the same time [duplicate]

I have a text file contain numbers as follows: 34 77 1716 150?.2 67.5892 11.9691 23 1?6 83 35 78 0 0 0 0 0 0 0 36 79 0 0 0 0 0 0 0 37 80 0 0 ? ? 0 0 0 38 81 0 0 0 ? 0 0 0 39 82 0 0 0 0 ? 0 ? 40 85 ...
1
vote
1answer
35 views

How to get Fedora 28 text console install under KVM to not prompt about text mode vs VNC

I've been trying to get unattended linux installs (fedora 28 in this case) working under KVM for some time. I've got it mostly worked out but it still asks me if I want to use text mode or fire up VNC....
-2
votes
5answers
78 views

TEXT processing with awk [closed]

I have text like below: select {{112,department}},{{112,client}},{{112,place}} from table where id=1 and {{112,cgid}} and {{113,evid}} I need to write into a file as {{112,department}} {{112,client}...
2
votes
1answer
96 views

Text file being identified as binary

Background I've been using lynx for a couple of years to dump automatically (via cron), process (using awk, sed, and tr), then mail (bsd-mailx) the contents of a web page. It's been working pretty ...
0
votes
0answers
29 views

Convert columns to rows [duplicate]

I want to convert a file that is formatted in columns like this: 1 a 2 b 3 c 4 d and want to get the following: 1 2 3 4 a b c d How can I do this using standard unix tools?
1
vote
2answers
42 views

Compile list of words from list of files

How would one take on this task? I've tried to do it with tr, and come up with this (with help of other similar question): tr -c '[:alnum:]' '[\n*]' < long_concatenated_file but.. Its a bit of a ...
0
votes
0answers
34 views

Wrong filenames timestamp listing in .txt file after comparison with the creation date

This is a part of my previous question about filenames timestamps correction, i wanted to separate it from the other question so that maybe some of the community member will not have a hard time to ...
0
votes
2answers
49 views

copy sections of a big file into many output files

I have one large file that looks like: Header1 Subheader1 l1 l1' l1'' Header2 Subheader2 l2 l2' l2'' Headern Subheader n ln ln' ln'' (in which n is ~25K) I need to paste l1-l1'', l2-...
17
votes
2answers
1k views

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 ...
1
vote
1answer
29 views

Why is my previous history command in the terminal overwriting other text? [duplicate]

Here is my .bashrc config for ps1 i believe ive done it correctly but any time i press up for a previous command it gets all jumbled up. I can write long lines of commands without it wrapping only the ...
0
votes
0answers
26 views

How to replace a serial of matrixes in a specific file, and output the these files named by different names (with the parameters) in Linux?

This is a complex question, I want to write a workflow or pipeline to draw parameters from priors parameters (M,B,D), then use these three parameters to generate 30 matrixes (20*20). I have written ...
1
vote
2answers
76 views

How to move the files to new directory based on names in text file?

I have tar.gz files like below in a directory df: A.tar.gz B.tar.gz C.tar.gz D.tar.gz E.tar.gz F.tar.gz G.tar.gz I also have text file move.txt with following columns information: ID Status ...
1
vote
4answers
613 views

Find all files containing keywords [duplicate]

I want to locate all text-files within a directory tree containing two words, word1 and word2 (for example). I cannot just grep for word1 word2, because this will only find occurrences where the two ...
0
votes
0answers
22 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 ...
1
vote
1answer
40 views

How to assign the whole line except several columns to an array index

I operate three similar text files all contain 8 fields and look like: File1: 145794 MEG -0.249553181556742 10.7024481844394 -2.66596894783271 0.00786178413495372 0.0601441357290167 -2....
0
votes
2answers
42 views

How to extract text inside first pair of colons [duplicate]

I have a log file that saves this kind of lines every time a file cannot be extracted from a tar. tar: foto/201802131354184186718718.xml: No se puede efectuar open: File exists tar: foto/...
0
votes
1answer
22 views

Embedded linux to read text and append it to another file [closed]

I have an embedded linux system that has limited commands available. VI being the only text editor I found so far. I can run SH to run a script but again, limited abilities. I need to ftpget a text ...
2
votes
2answers
103 views

Sample out one element from each row of file until k

I am new to UNIX and am trying to learn basic level text processing in UNIX so maybe this question may seem very basic but I would really appreciate any guidance. I have a text file as below A 1 B 2 ...
-3
votes
1answer
57 views

Wanted to know the correct way of using sed command by inserting text from one file to another? [duplicate]

Due to some problems in this site when it comes to displaying. I am using '{' instead of '<'. Here is my sed command: sed 's/{head/*backbutton_and_scroller_script.txt*{head/' report.usc20.txt I ...
2
votes
1answer
244 views

What Ctrl+Shift+X does what it does in text fields in the browser(linux)?

I had accidentally pressed Ctrl+Shift+X while typing in the wordpress WSIWYG editor, And all the text kinda scrambled to the right, which isn't exactly the same as right align though. Observation 1: ...
-1
votes
1answer
30 views

Change duplicating lines in file

Need to find all duplicate lines in file. For each case keep first occurrence as is, and append incremented counter to each next occurrence. For example: original file A B C A C A C need A B C ...
1
vote
2answers
47 views

insert a string to a list variables in text file [use sed]

I want to add zsh-autosuggestions plugin to ~/.zshrc by script. original text: plugins=(git) or plugins=(git some1 some2) target : plugins=(git zsh-autosuggestions) This doesn't work. sed ...
0
votes
1answer
39 views

Problem using find with filenames containing spaces [duplicate]

I'm trying to run join a bunch of files using the find command. I have determined that filenames containing spaces are giving me a problem. The following comand works for files that do not contain ...
0
votes
0answers
309 views

Script to create a openVPN .conf file for OpenWRT with multiple client configuration

I'm trying to automatically generate, from hundreds of files(ovpn client configurations), a config file for openVPN on a openWRT router. My problem is that I have hundreds of connection and I need the ...
-2
votes
1answer
86 views

How to find the most popular word in the text in a text file through the linux terminal [duplicate]

How to find the most popular word in a text file through the linux terminal? Need to write a script
2
votes
2answers
100 views

Improve awk command processing file

Situation I have awk command reads results from mywebsite.log current command awk 'BEGIN{ curr_d=strftime("%d/%b/%Y", systime()) } $3~"^\\["curr_d{ cc[$8]++ } END{ for(i in cc) print i":"cc[i] }' ...
2
votes
1answer
2k views

Install Ubuntu 16 with text based and use ubuntu with no GUI

I have tried installing Ubuntu 16 with minimal cd and I'm getting the text based installation, but the thing is I want to install ubuntu only with text-based installation and after that, I want to use ...
0
votes
1answer
60 views

How to make “incremental” replace in files with bash

I need to search files in directory with specific pattern (for example foobar) and replace them with foobarXXX, where XXX is a number. For example, there were two original file snt130.txt My ...
1
vote
2answers
366 views

Delete first 10 characters of every line in textfile

Suppose I have a file, test.java It starts off like this every line /* */ package com.a; /* */ import java.util.List /* */ etc I want to remove the first 10 characters from every line ...
0
votes
2answers
39 views

Converting spaces in a text file to periods/full stops

I'm quite new to Linux so forgive my ignorance. I have a regular text file with plain text. I would like to know if it's possible to convert all the spaces within the file to periods/full stops. ...
3
votes
3answers
369 views

View text file and highlight numbers

I'd like to view a text file on the terminal and highlight its numbers. Something like I get when I open it with gedit. I haven't been able to do this with less, cat, vim or other viewers/editors. P....
-3
votes
3answers
56 views

how to find a text and copy the text after?

I have a script that create a txt file with a lot of information. I want to check if there is a specific text in it, and copy what come after. for example, this is the txt file: blablablaWANTEDTEXT[...
0
votes
1answer
509 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@...
1
vote
2answers
1k views

Write shell output to MS Word document

Problem: I usually output text from my shell to file using >. I am trying to find an equivalent process that outputs a MS Word document (.doc or .docx). I was thinking to use libreoffice and ...
2
votes
0answers
31 views

How to convert pdf to an open text format in a fast way? [duplicate]

How to convert pdf to an open text format in a fast way? i got hundreds of pdfs from my old hd and i'd like to clean them and convert to a safe open format, so i've been scatering internet allover and ...
-2
votes
1answer
358 views

Removing lines from text file that contain string at beginning and string at end - and keep one

It took me a while to word this best. Problem 1: Is there a way to find lines in a text file that have the same string at the beginning and the same strings at the end? Beginning and end strings ...
0
votes
2answers
52 views

Create a url file with multiple links

i need to edit the page number of multiple url links in the text file. eg: http://gk4success.com/questions.php?page=1&parent=0&lang=2&c-id=27&q_type= ... http://gk4success.com/...
1
vote
2answers
372 views

replace a block of text with the contents of a file

I would like to replace the contents between $Elements$ and $EndElements$ in text file, f1, with the data from another file, f2. The contents of f1 is given simply by $Elements$ 3 1 5 7 $EndElements$...
3
votes
2answers
304 views

Line by line modifications in Unix

I am looking for a way to do the following with a pipe delimited file in UNIX, for EACH LINE and am not sure where to start: Look for a character in a line of text (assume using GREP?) If found then ...
1
vote
3answers
397 views

how to remove last two "-delimited strings from each line in a large file

I have numerous 2GB space-delimited files from a source system. Each row in each file contains the same number of strings surrounded by " as text qualifiers. I need to eliminate the last two ...
-1
votes
2answers
3k views

Earliest viewer for viewing .json files?

While almost all text-editors can view .json files, I am sure there are some or one which show .json files in all its glory. Could somebody share name or names of native .json viewers rather than text-...
3
votes
1answer
302 views

Why is it not possible to search through text file contents encoded in UTF-16?

I understand that e.g. catfish and gnome-search-utils both can search inside file contents that are UTF-8 encoded. To be able to search for words or numbers within text files one would have to convert ...
6
votes
2answers
569 views

How do I get sort to show me results in human-like sorted order?

Running the sort command on the first field of a file sort -k1,1 file.txt like this: 1,2,3 2,1,1 10,2,1 gives me: 1,2,3 10,2,1 2,1,1 instead of: 1,2,3 2,1,1 10,2,1 I don't want 10 before 2. Is ...
2
votes
5answers
1k views

Use sed command to check if a particular line exists, if not, add it

I want to add more terminals to the file /etc/securetty. More specifically I would like to add pts/n, where n is in the range 0-9, if it does not exist. Is this possible through sed command? The ...
0
votes
3answers
296 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 ...
1
vote
1answer
63 views

Why does § enable me to remove two characters in a bash promt?

This is a wierd and very specific problem in terminator. When i type the character "§" into a terminal window and then press backspace twice it allows me to always remove two characters, even if they ...
1
vote
1answer
836 views

Searching files containing non-ASCII characters

I'm trying to find files in a directory that contains some non-ASCII Unicode characters. The exact characters that I have to find are not known to me beforehand. Conceptually, this should be an easy ...