HP3000-L Archives

August 1999, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Reply To:
Date:
Mon, 16 Aug 1999 18:07:24 GMT
Content-Type:
text/plain
Parts/Attachments:
text/plain (31 lines)
To "chop" your file in Unix use:

fold -w291 in-file > out-file.

Your awk statement has the following errors:

1. The "-F" flag is used to indicate the field separator character. For
example: awk -F@ '{...}' 2. The correct syntax of the printf() function is
printf("%291s\n",$0) 3. Such statement would extract the first 291 characters
of each line of your input file, and not "chop" it.

MK

In article <[log in to unmask]>,
  Ken Winslet <[log in to unmask]> wrote:
> Does anyone out there know the command to split a file in the Unix world.
>
> I have a file and need to chop it up into 291 byte records.
>
> I tried this command but I get errors:
>
> awk -F '(printf("291%s\n",$0)' file2.dat>file2.dat
>
> any help would be great!!!!
>
>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

ATOM RSS1 RSS2