HP3000-L Archives

July 1999, Week 4

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:
Per Ostberg <[log in to unmask]>
Reply To:
Date:
Fri, 23 Jul 1999 09:47:57 +0200
Content-Type:
text/plain
Parts/Attachments:
Meddelandetext (31 lines)
hi,
awk is definetely not my native language ;-) but I think -F specifies
field separators, in this case it's either none, space or the "regexp"
'(printf("291%s\n",$0)', you don't need it if you're interested in the
whole record. The printf statement also looks suspicious (it is the same
format rules as ANSI C (or close at least)). You're also missing a ')'.
What errors do you get?

I'd try something like (and this is not tested, and I'm not sure it's
completely safe to use the same file for input and output):

awk '{printf("%0.291s\n",$0)}' file2.dat>file2.dat

IIRC, '%0.291s' means the string printed is max 291 chars and min 0.

hth
/per

> 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!!!!
>

ATOM RSS1 RSS2