Re: Conversion of text in shell

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



On Fri, 2007-10-12 at 17:15 -0400, Marko A. Jennings wrote:
> On Fri, October 12, 2007 4:54 pm, roland hellström wrote:
> ><snip>

> Assuming that you have those lines in a file called numbers.txt, you can
> execute the following (all on one line):
> 
> cat numbers.txt | tr '.,e' ',^^' | awk -F^ '{printf("%s & $%s \\cdot
> 10^{%s}$\\\\\n", $1, $2, $3);}'

Just a reminder from an old anal-retentive: the creation of the extra
process (for cat) and the creation of a pipe is not needed. Use the
standard input redirection available in bash.

   tr .... < numbers.txt

will do the job.


> <snip>

--
Bill

_______________________________________________
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