I have a file like the following:
a,b,c,d,e,f
1,2,3,4,5,6
7,8,9,0,1,2
I need to join the last two lines with a comma, like so:
a,b,c,d,e,f
1,2,3,4,5,6,7,8,9,0,1,2
The problem is that this is all inside a loop that will add two new lines to that file, say
a,b,c,d,e,f
1,2,3,4,5,6,7,8,9,0,1,2
0,9,8,7,6,5
4,3,2,1,0,9
And now I need to do the same to that last line for the file to end like
a,
In the same spirit as this other question: cat line X to line Y on a huge file:
Is there a way to open from within Emacs (and
show on a buffer) a given set of lines (e.g. all lines between line X and Y) from a huge text file?
E.g.
I am trying to use tasker to read at random any 1 of 3 lines of text from a text file on my /SD when I ask it "how are you?"
I have the lines set out like this in the text file:
great, how are you
;;;
fine thanks
;;;
not so good
;;;
I have tried using the "File" action and "Read Line", and know I have to put %VOICE ~ *how are you* in the bottom
I'm having a issue, I need to copy the file contents and remove a couple of lines if they match the output from a previous command.
I have a text file which is having 30000 lines in it. I have to create a xml file for each 10000 lines until all the lines in the text files are written. Also please help how can i get number of lines in the text file in a shell variable?
Hi All,
I am creating a text file using perl. The first record I am writing as "$line" and all the other as "\n$line". At the end the file is having N number of lines.
Hi All,
Need a small help in writing a shell script which can delete a few lines from a file which is currently being used by another process.
File gets appended using tee -a command due to which its size is getting increased.
Contents like :
Code:
[INFO] 25/09/2012 05:18 Run ID:56579677-1
My requirement is to remove lines which are more than 1 month old...
A huge (up to 2 GiB) text file of mine contains about 100 exact duplicates of every line in it (useless in my case, as the file is a CSV-like data table).
What I need is to remove all the repetitions while (preferably, but this can be sacrificed for a significant performance boost) maintaining the original sequence order. In the result each line is to be unique.
In a text file I need to comment out all lines by adding a ";" as first character of each line. What is a good way to do this? I thought of Vim's visual block mode, but I couldn't find a "select all" option and marking several hundred lines manually also isn't great ;-) Any idea? I have nano, vi and vim at hand, I would prefer one of those for this task.