vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| On Mon, Apr 04, 2005 at 07:20:46AM -0700, pablo hernandez wrote: | | I want to "cat" one file , but shortening each line to maximum 70 characters . | | I think this can be done with awk , but probably there is a easy way : awk '{print substr($0,1,70)}' infile >outfile Bob -- Bob Stockler - bob@trebor.iglou.com Author: MENU EDIT II - The BEST Creator/Editor/Manager for filePro User Menus. Fully functional (time-limited) demos available by email request (specify OS). |
| |||
| "Bob Stockler" <bob@trebor.iglou.com> wrote in message news:20050404151525.GD6745@trebor.iglou.com... > On Mon, Apr 04, 2005 at 07:20:46AM -0700, pablo hernandez wrote: > | > | I want to "cat" one file , but shortening each line to maximum 70 characters . > | > | I think this can be done with awk , but probably there is a easy way : > > awk '{print substr($0,1,70)}' infile >outfile > > Bob When logged in I see an environment variable COLUMNS set to 80. What is this used for? Ron |
| |||
| On Mon, Apr 04, 2005 at 10:38:57AM -0500, Ronald J Marchand wrote: | "Bob Stockler" <bob@trebor.iglou.com> wrote in message | news:20050404151525.GD6745@trebor.iglou.com... | > On Mon, Apr 04, 2005 at 07:20:46AM -0700, pablo hernandez wrote: | > | | > | I want to "cat" one file , but shortening each line to maximum 70 | characters . | > | | > | I think this can be done with awk , but probably there is a easy way : | > | > awk '{print substr($0,1,70)}' infile >outfile | > | > Bob | | When logged in I see an environment variable COLUMNS set to 80. What is | this used for? That tells programs (examples: less and mutt) how wide your window is. Right now I'm typing this in a 123 column wide ScoTerm window, using mutt to reply, so I have COLUMNS set to 123. Bob -- Bob Stockler - bob@trebor.iglou.com Author: MENU EDIT II - The BEST Creator/Editor/Manager for filePro User Menus. Fully functional (time-limited) demos available by email request (specify OS). |
| |||
| Bob Stockler <bob@trebor.iglou.com> wrote in message news:<20050404151525.GD6745@trebor.iglou.com>... > On Mon, Apr 04, 2005 at 07:20:46AM -0700, pablo hernandez wrote: > | > | I want to "cat" one file , but shortening each line to maximum 70 characters . > | > | I think this can be done with awk , but probably there is a easy way : > > awk '{print substr($0,1,70)}' infile >outfile > > Bob Thanks Bob , so awk is the only way . regards Pablo |
| |||
| pablo hernandez wrote: > Bob Stockler <bob@trebor.iglou.com> wrote in message news:<20050404151525.GD6745@trebor.iglou.com>... > >>On Mon, Apr 04, 2005 at 07:20:46AM -0700, pablo hernandez wrote: >>| >>| I want to "cat" one file , but shortening each line to maximum 70 characters . >>| >>| I think this can be done with awk , but probably there is a easy way : >> >> awk '{print substr($0,1,70)}' infile >outfile >> >>Bob > > > Thanks Bob , > > so awk is the only way . > If you have some aversion to awk, you could use cut. "cut -c 1-70 filename > otherfile" Or Perl, Python, C or any of a few dozen other tools. |
| |||
| On Tue, Apr 05, 2005 at 12:17:07AM -0700, pablo hernandez wrote: | Bob Stockler <bob@trebor.iglou.com> wrote in message news:<20050404151525.GD6745@trebor.iglou.com>... | > On Mon, Apr 04, 2005 at 07:20:46AM -0700, pablo hernandez wrote: | > | | > | I want to "cat" one file , but shortening each line to maximum 70 characters . | > | | > | I think this can be done with awk , but probably there is a easy way : | > | > awk '{print substr($0,1,70)}' infile >outfile | > | > Bob | | Thanks Bob , | | so awk is the only way . No, there are other ways. For instance: cut -b 1-70 infile >outfile You mentioned awk, so I gaqve you that command. Bob -- Bob Stockler - bob@trebor.iglou.com Author: MENU EDIT II - The BEST Creator/Editor/Manager for filePro User Menus. Fully functional (time-limited) demos available by email request (specify OS). |
| ||||
| pablo hernandez wrote: > > I want to "cat" one file , but shortening each line to maximum 70 characters . > > I think this can be done with awk , but probably there is a easy way : cut -c1-70 file or cat file | cut -c1-70 > > any help ? > > thanks > > pablo -- Steve Fabac S.M. Fabac & Associates 816/765-1670 |