Questions tagged [text-manipulation]
The text-manipulation tag has no usage guidance.
44
questions
0
votes
2
answers
3k
views
How to combine and permute two wordlists
I would like to combine and/or permute the words from a list up to 3 times. For example:
If I have one list with:
apple
orange
cafe
and another list with:
11
22
33
it should produce combinations ...
55
votes
4
answers
40k
views
Vim: how to paste a block of text at the end of multiple lines?
Say I have a block of text like this:
// Comment1
// Comment2
// Comment3
And I want to append each of these lines to the end of 3 corresponding lines of code:
foo = 1;
bar = 2;
baz = 3;
So that ...
5
votes
3
answers
7k
views
Reverse text in Notepad++
This question was asked several years ago without an accepted answer. The question has also long been inactive. Seems a simple piece of functionality, so perhaps a recent plugin provides the feature.
...
119
votes
17
answers
193k
views
Linux command to repeat a string n times
Is there any built-in Linux command that allows to output a string that is n times an input string??
35
votes
7
answers
90k
views
How to replace multiple spaces by one tab
I have some text files which contain some columns separated by a various number of spaces, but instead I need one single tab as a separator. Is it possible to do in Bash?
-1
votes
3
answers
103
views
How do I switch to only using a keyboard for input?
Not sure if this in on topic here. I'm trying to completely switch to keyboard, yet, there is one main task I cannot achieve: to copy text from browsers and almost any program that is not a text ...
0
votes
1
answer
392
views
Moving characters' position
I am trying to automate the work of changing the position of characters in text. I think the right regex pattern will do the trick, but I haven't been able to create one.
I have text like this:
abcd&...
0
votes
1
answer
17k
views
Delete multiple lines by specifying their line numbers in Notepad++
I have a text file that has 255 lines and I want to delete/remove specific non-consecutive lines (lines 2, 4, 56, and 180 for example) regardless of their contents. I cannot use regular expression ...
0
votes
1
answer
89
views
How to increment group numbers in a settings file?
I have an application with a settings file (.ini) that contains data in the common format:
[group1]
foo=bar
bar=baz
...
[group2]
foo=bar
bar=baz
...
...
[group500]
foo=bar
bar=baz
...
where the ...
6
votes
3
answers
7k
views
Remove non-duplicate lines in Linux
how can I remove non-duplicate lines from text file using any linux program linke sed, awk or any other?
Example:
abc
bbc
abc
bbc
ccc
bbc
Result:
abc
bbc
abc
bbc
bbc
Second list have removed ccc ...
0
votes
2
answers
134
views
How to add column with numeric range of ID's after grouping data in Excel
In the data I have fields "ItemName" and "ID". I need to group rows by "ItemName" and somehow make a "human readable" range of sequential numbers in "ID&...
0
votes
1
answer
208
views
How to do this in Notepad++?
I have thousands of lines that look like this:
Username | Password | Account Status | Region | Email | Summoner Name | BE | RP | RP Refunds | Level | Curr Rank | Prev Rank | Champs | Skins | Last ...
8
votes
3
answers
18k
views
FINDSTR: Line is too long
Windows FINDSTR command is useful for sifting through large amounts of data; it filters out lines of text that match or don't match a specified pattern or string (like GNU/BSD grep).
But it refuses ...
1
vote
3
answers
7k
views
How to extract a part of a line that is between two specific strings via a batch script
I am trying to extract strings which are between testid= and ].
Input text file
SEVERE TEST 11/18/2019 8:00:41 AM Could not find INPUT with [testid=2345]
SEVERE TEST 11/18/2019 5:02:11 AM Could ...
1
vote
1
answer
240
views
How can I sort the output of awk, disregarding a certain character?
I am trying to print out the Chinese font I have in my laptop, and sort the output with respect to their name that could be referred to in LaTeX. This could be done with the following command:
fc-...
0
votes
1
answer
141
views
Linux version sort; letters first
GNU sort -V is great for sorting IP adresses. Unfortunately it throws all lines with leading letters (as opposed to numbers) to the bottom of the pile. Is there a way around it?
Note:
• 192.168.0.103 ...
17
votes
7
answers
28k
views
How can I reverse a line in Notepad++?
Is it possible to reverse a single line in Notepad++?
Example:
Hello world
Would change to
dlrow olleH
Should I install a plugin for such functionality?
UPDATE: I'd like to keep the clipboard in ...
5
votes
5
answers
3k
views
How to chain awk print statements?
Okay, here's a quick example; me isolating a host's IPV4 in three steps:
ip -br a
lo UNKNOWN 127.0.0.1/8 ::1/128
eth0 DOWN
wlan0 UP ...
1
vote
3
answers
1k
views
How to split words in Excel
In Excel, how do I split a word from cell A1 in all possibilities of 3 sequenced letters?
Example:
If cell A1 contains word university, I need that it generates following text in the other cells:
...
2
votes
1
answer
95
views
What's the best method for JPEG text manipulation?
I have a relatively simple graphic; a technical diagram with various bits of text throughout.
The text is in another language (Czech/Slovak). It's printed clearly enough to be accurately ...
-1
votes
1
answer
121
views
How can I tag text based on its indentation?
I want to tag textual content (with XML-like tags)
based on its indentation depth. Blank lines should be preserved.
The example below has its content indented with 1, 2 or 3 tabs.
INPUT
aaa
bbb
...
1
vote
2
answers
858
views
Concatenate Windows text files with title or date?
I have a directory where I have a bunch of text files being dumped for logging that are each in a clean tab delimited format. Each file is named with it's timestamp which I also need. I need to merge ...
-3
votes
1
answer
474
views
Transpose text using sed
Please help me figure out how to solve this using sed.
Given the following text:
Kerala
4222 8129 8163 8164
Delhi
8502 8503 8504 ...
0
votes
2
answers
724
views
How to repeat each line of a file, from the Linux command line?
How to make a file like:
one
two
three
...
into:
one one
two two
three three
...
I'm thinking this must be possible with one simple Linux command. If my editor had block selections or macros I ...
0
votes
1
answer
11k
views
UNIX: how to merge 2 text files?
Is there a way to merge 2 text files into one (by appending the content of the second right after the first one) in Unix ?
0
votes
2
answers
2k
views
What the best program for string manipulation [closed]
I would like to know the best program (Surely a text editor) to make string manipulation like string substituion.
By the way, I would like to do the next:
String manipulation of type String ...
0
votes
1
answer
10k
views
Regular Expression to Add Space After 10 Digits
How would I go about writing a regular expression to do a find/replace operation in order to add a space after 10 digits of ever number that is 20 digits long?
I have a long list of phone numbers ...
2
votes
3
answers
1k
views
How can I remove unnecessary text from a command line output?
I'm using GeekTool, which takes the output of terminal commands and turns them into Desktop widgets, and wanted to display the current battery percent of my bluetooth keyboard to the Desktop in the ...
1
vote
1
answer
15k
views
Using grep; how do I show the Nth occurence of a pattern?
Using grep; how do I show the Nth occurence of a pattern?
For instance; man sh |grep -A3 -- '-c' will return several matches.
I might want to isolate the 3rd occurrence only, so that it shows:
--
...
32
votes
12
answers
33k
views
Efficiently remove the last two lines of an extremely large text file
I have a very large file (~400 GB), and I need to remove the last 2 lines from it. I tried to use sed, but it ran for hours before I gave up. Is there a quick way of doing this, or am I stuck with ...
1
vote
0
answers
51
views
Parsing (or Converting) Buffered Output
If a dynamic, text-based, CLI application doesn't include an option for producing unbuffered text output; what options do I have for parsing said output?
Can it be converted to a more appropriate ...
1
vote
4
answers
163
views
Edit all lines at once
I have a .txt file with almost all of the airports in the world. Each line is a different airport, and the lines are in this format: City, Country - Airport Name (Airport Code)
ie:
Le Mans, France - ...
1
vote
2
answers
80
views
Select all instances of quoted text from a file
Is there any way to grep or obtain in any other way all instances of text within each pair of double quotes in a file? I've seen answers like this: https://stackoverflow.com/questions/15435056/grep-...
1
vote
3
answers
220
views
Extract multiple sections of pages from a pdf
I have a ton of pdf files (past exams), of which only two sections of pages (about 8 pages each) are relevant to me. I'd like to extract the two sections into a separate file for each of them.
I used ...
0
votes
1
answer
811
views
Line Manipulation Reformat text Notepad++ or PSPaD
I have about 40,000 lines I need to look like first line - no paragraph marks.
The trouble is, I can't use join lines then use (\d\D+)& $1\n to get like line 1 because of numbers inside of ...
2
votes
2
answers
2k
views
how to insert text at the beginning of each paragraph in bash
I have a file with multiple paragraphs separated by blank line. Technically they are not paragraphs just sections of text separated by blank line.
I want to number the paragraphs so to speak by ...
1
vote
2
answers
787
views
Adding text to the end of multiple files, minus one line( Adding return 0; at the end of each program in C)
I have a bunch of C programs from K&R and of course, no return statement. I was wondering if there was a way to cat to the end of each file (except one line before the end, so EOF - 1) the ...
2
votes
2
answers
7k
views
Is there any way to reverse text and *character* direction in a pure text document?
I have some text in Latin script (English transcription of Farsi) that I would like to display right-to-left in ordinary text documents (and on my iPod) – is that possible? How?
Here’s an example of ...
6
votes
5
answers
11k
views
How Does One Remove Duplicate Text Lines From Files Larger Than 4GB?
I am looking for an open source (possibly 64 bit) windows text editor that will allow me to remove duplicate lines from an extremely large (4GB+) text file.
What do you use to remove duplicate lines ...
1
vote
1
answer
917
views
Delimited string to rows in Microsoft Excel
I am looking to see if I can solve this problem using Excel- if not, I can write a script that would help me do this instead but it would be a little more time consuming.
Here is my data set:
This ...
0
votes
1
answer
791
views
Edit and rearrange a file via command line, imported from Excel 2003
I have a text file imported from Excel 2003 in the following basic format.
43038 12500 s.ramesh labour
43038 13000 m.ramesh doctor
I have to arrange this file in such a format ...
2
votes
1
answer
7k
views
Character String Conversion using Python
Hi I have a website that is in Traditional Chinese and when I check the site statistics it tell me that the search term for the website is å%8f°å%8d%97 親å%90é¤%90廳 which obviously makes no sense ...
1
vote
2
answers
359
views
Mass text manipulation?
I have a text file of a couple of hundred thousand words. E.g.:
word1
word2
etc
I want to know what program I can use to easily:
Add "FRONT" to the front of the text, and
Add "BACK" to the end of ...
2
votes
5
answers
6k
views
Easiest way to remove unwanted lines from a huge text file
I have a large text file with a size of more than 30 megabytes. I want to remove all the lines which don't match some specific criteria, e.g. lines that don't have the string 'START'.
What's the ...