Re: Vim scripting - cursor motion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



From: Jussi Hirvi <listmember@xxxxxxxxxxxx>

>     :% s/\t/","/g
> Then I should add something to the beginning of file (line 1, char 1).
> And append something to the end of the file (last line, last char). But 
> I cannot find a way to do this. Should I move the cursor (and how?), or 
> what?

echo "First Line" > NEWFILE
cat FILE | tr '\t' ',' >> NEWFILE    or   sed 's/\t/,/g' FILE >> NEWFILE
echo "Last Line" >> NEWFILE

or

awk ' BEGIN { print "First Line"; } { gsub(/\t/, ",", $0);print $0; } END { print  "Last Line"; } ' FILE > NEWFILE

JD
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos



[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux