home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!mcsun!sunic!aun.uninett.no!news.uit.no!stud.cs.uit.no!ronnya
- From: ronnya@stud.cs.uit.no (Ronny Haavard Arild)
- Subject: Awk problem
- Sender: news@news.uit.no (USENET News System)
- Organization: University of Tromsoe, Norway
- Date: Tue, 8 Sep 1992 11:35:17 GMT
- Message-ID: <1992Sep8.113517.17401@news.uit.no>
- Lines: 27
-
- When I write this line in my shell (zsh):
-
- awk '/ . [0-9.*]+ +[0-9]+ +[0-9.]+ */ {printf "%10s|%5s|%4s|%s\n", \
- substr($0,7,10), substr($0,20,5), substr($0,27,4), substr($0,33,120)}' \
- <oldfile> | tr "[A-Z]" "[a-z]" > <newfile>
-
- from this line in <oldfile>:
-
- 0000001231 212 8.1 African Queen, The
-
- I get this line in <newfile>:
-
- 0000001231| 212| 8.1|aGS═╟┴╤ q┌╔╔╤, tI╔
-
- While what I want is this:
-
- 0000001231| 212| 8.1|african queen, the
-
- Could someone please help me out, as I'm stuck. From the little I know about
- awk this should work.
-
- Ronny
- --
- Ronny H. Arild | ronnya@stud.cs.uit.no | "The knack of flying is learning
- P.O.Box 5580 | University of Tromsoe | how to throw yourself at the
- N-9022 Krokelvdalen | ****** NORWAY ******* | ground and miss."-Douglas Adams
- copy this line into your .signature to protect it against viruses! [version-9]
-