Re: script question

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



Hi,

On Wed, Oct 15, 2008 at 10:48, Jerry Geis <geisj@xxxxxxxxxxxxxxx> wrote:
> I am trying to create a script that takes an entire file,
> drops the first 19 characters from each line and creates a new file.
>       newline=`echo $LINE | cut -f 19-`

What you want is "cut -c 19-" (-c as in characters) and not "cut -f
19-" (-f as in fields).

>       echo $newline >> output.txt

This will also remove the spacing. You should at least use echo
"$newline" >>output.txt, but in any case it's silly as you can just:

cut -c 19- <test.txt >output.txt

HTH,
Filipe
_______________________________________________
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