I have to copy few lines for example 2 3 7 from file and paste it to another. Can it be done with "cut" and how to do this ???
Posted on 2004-03-16 09:00:14 by AceEmbler
cut works within a line of text, so it alone cannot do it (cut -d \n -f 2,3,7 for example won't work).

Try cat my_file | tr "\n" "\t" | cut -d \t -f 2,3,7 | tr "\t" "\n"

Mirno
Posted on 2004-03-16 16:05:26 by Mirno

cut works within a line of text, so it alone cannot do it (cut -d \n -f 2,3,7 for example won't work).

Try cat my_file | tr "\n" "\t" | cut -d \t -f 2,3,7 | tr "\t" "\n"

Mirno


this one copy everything.
Posted on 2004-03-16 17:12:14 by AceEmbler
But i made it already.
copy line 12 from file1 to file2

head -n 12 FILE1 | tail -n 1 >> FILE2
Posted on 2004-03-16 17:26:44 by AceEmbler
IF you have gpm installed you can less the file and select from one Vt past to another VT with the mouse as far as I know all command line editors let you do this
Posted on 2004-03-24 14:00:22 by rob.rice