0
votes
2answers
62 views

Print or grep lines which start from second column

I want to print lines which start from second column (first column is white space). $ cat test.txt first second third four second five seven Output should be: second second ...
0
votes
2answers
34 views

Inserting a linebreak in lines starting with a pattern

I have a huge file that has the following format: #pair: 0 1 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 ...
0
votes
1answer
195 views

How to replace text strings by reading in list using sed

I'm trying to come up with a sed script to run from the shell. I need to be able to read in a list of UUIDs from an external file, which contains two columns origtexta replacementa origtextb ...
0
votes
2answers
61 views

Replace words on given line numbers

I have a file 1.txt INTEGER-d_int () INTEGER-d_int () INTEGER-d_int ( ) INTEGER-d_intClass() INTEGER-d_intClass new() and I want to replace the occurrence of d_int with d_INT on the ...
4
votes
4answers
76 views

Apply regex to certain occurrences

I have a large file with plain text (no html tags, etc.). What I want to do is to apply regex to whole file on the one hand but on the other I want to choose which changes will be applied. For ...
3
votes
4answers
842 views

How to replace a list of strings by another list

I have a file which has (many) strings I'd like to replace, so I thought about using a simple command like: sed 's/string1/string2/g' file1 > out However, there are too many strings for that ...
2
votes
5answers
157 views

Editing the same file from multiple computers

My friend and I need to view and edit the same file at the same time. We were using Google Docs, but the firewall is now blocking it. If we connected our computers with a network cable (no hub or ...
2
votes
1answer
170 views

Delete first lines from a Unicode html file

I have an HTML file that is in UTF-8 format and I want to remove the first five lines from it. I've tried using sed but it doesn't work in this case: sed "1,5d" Result.html>small2 It actually ...
2
votes
1answer
486 views

How can I edit huge RTF files produced by Windows in Linux?

I have tried LibreOffice, and Abiword on Linux Mint 13, and in both cases, on the sorts of RTF files I use (lots of font changes, language changes, color changes, underlining, etc.), the application ...
0
votes
1answer
88 views

How can I switch vim mode quickly?

This question is not the same as In vim, how can I quickly switch between tabs?, but what I want is a bit similar to it, since we are all trying to find shortcuts when editing with vim:) Now I am in ...
2
votes
3answers
297 views

Adding text to the beginning and end of a number of files?

I have a number of files in a directory hierarchy. For each file, I'd like to add "abcdef" to the beginning, on its own line, and "ghijkl" to the end, on its own line. For example, if the files ...
3
votes
5answers
4k views

How to split a text file into multiple text files

I have a text file called entry.txt that contains the following: [ entry1 ] 1239 1240 1242 1391 1392 1394 1486 1487 1489 1600 1601 1603 1657 1658 1660 2075 2076 2078 2322 2323 2325 2740 2741 2743 ...
4
votes
4answers
817 views

How can I edit a file if there is no vi, vim, joe, etc?

Is there a way to edit a file if there are no vi, vim, joe, mcedit? In another words is there a way to edit a file using just the shell commands?
2
votes
3answers
348 views

How to substitute multiple lines between delimiters

Given the text example: .... text ,.. {{{python string1 = 'abcde' string2 = '12345' print(string1[[1:3]]) print(string2[[:-1]]) }}} .... text ,.. The [[ and ]] also appear outside of {{{ too. ...
0
votes
3answers
110 views

Process plain text data

I've this plain text file that I need to be automatically examined and results written in another plain text file. Note that I'll use plain text and CSV interchangeably, since CSVs are plain text ...
0
votes
1answer
613 views

Editing files on linux server from windows

I want to edit text files on Linux server from Windows, using text editor like Notepad++ or UltraEdit. I've managed to do so using WinSCP. It can edit files remotely and offers me to choose local ...
7
votes
5answers
2k views

How can I justify plain text in Linux?

I'm composing a plain text (.txt) document that has left-and-right justified paragraphs. I manually add spaces, breaking words with hyphens if necessary, until the lines are uniform length. To use an ...
1
vote
5answers
1k views

Disk Based Text Editor to Edit File Larger than Memory

I am using Ubuntu and looking for a good editor to edit a file that is > 4GB. I just need to put content at the end and beginning of the file. I suppose I could use something like cat "text to add" ...
4
votes
5answers
1k views

Remote edit with local editor (Linux)

I have a server I can ssh into, and I am also running Ubuntu. How do I edit this remote file using any program I have installed on my local Ubuntu, without copying it to local, editing it, and copying ...
4
votes
2answers
435 views

Text files on linux have “<97>” characters

When viewing a particular text file in vim or less on Linux or OS X, all the en dashes show up as highlighted "<97>" characters. What control-sequence do I need to type in order to substitute the ...
1
vote
1answer
2k views

Is there a way to make Nano support auto-complete and auto-bracket closing?

Does anyone know if there's a way to make nano support auto-complete and auto-bracket closing?
5
votes
4answers
11k views

Text / log editor with auto-refresh support

I'm looking for a text editor / log manager of some kind that will automatically refresh a file's contents when it changes. I have a single target log file (e.g. current.log) that is overwritten ...
1
vote
3answers
796 views

How to grep only selected words from a file?

I need to get a list of all the email addresses from a file. I was trying to use grep @ filename but that returns the entire line. Is there anyway I can get it to return only the email address ...
1
vote
3answers
644 views

Does anyone have tips for using the linux text-editor joe? is it available on ssh?

I found a few great features in the joe text editor for the command window: You can: Keep the command help menu visible all the time. Split the current view into two panes (top, bottom) so that ...
18
votes
10answers
26k views

Convert unix line endings to windows

I recently moved back to Windows from Linux. I have some files with CRLFs, some with LFs and some that are mixed. Is there a utility that will help me find all my Unix-touched files and convert them ...
30
votes
4answers
18k views

How to make cut/copy/paste in GVim on Ubuntu work with Ctrl+X,Ctrl+C,Ctrl+V?

By default, the cut/copy/paste short-cuts in GVim on Ubuntu are: Cut "+x Copy "+y Paste "+gP I would like to use control key combos in GVim, like I use in Firefox and othe gnome ...