Ask a Question related to FreeBSD, Design and Development.
-
David Bear #1
awk print
I'm using awk to parse a directory listing. I was hoping there is a
way to tell awk to print from $2 - to the end of the columns
available.
find ./ -name '*stuff' | awk '{FS="/" print $3---'}
the $3-- I want to mean -- print from col 3 to the end.
Any awk pros?
--
David Bear
phone: 480-965-8257
fax: 480-965-9189
College of Public Programs/ASU
Wilson Hall 232
Tempe, AZ 85287-0803
"Beware the IP portfolio, everyone will be suspect of trespassing"
David Bear Guest
-
Saving Print Settings in a Document via Print Advanced Menu
I just discovered in the Help file you can do the above but it doesn't say how. I want to save the document so it can be printed on anyone's printer... -
Creating PDFs from Freehand -- print to PDFvs. export vs. print/scan to PDF?
I've had a lot of compatibility problems with created presentations so have started using Acrobat instead of trying to export my Macromedia Freehand... -
print to pdf doesn't work. queue in the print center stopped
hi, have a huge problem with printing a pdf. when i'm in illustrator for example and choose to print a simple page to pdf, it moves the file into... -
Exiting Print document within the print action
Hello, I have a message to display when the user goes to print the document IF a certain condition is met. This part works fine. The message is a... -
Illustrator 10 Print Space settings in Print Dialog
Howdy all; I've got a peculiar situation that I haven't found an answer to yet. On my laptop PC (Windows XP Home) when I go to print a document... -
David Bear #2
Re: awk print
On Wed, Feb 23, 2005 at 11:19:26PM +0100, Roland Smith wrote:
thanks for the advice. No, this doesn't do what I want.> On Wed, Feb 23, 2005 at 02:40:10PM -0700, David Bear wrote:>> > I'm using awk to parse a directory listing. I was hoping there is a
> > way to tell awk to print from $2 - to the end of the columns
> > available.
> >
> > find ./ -name '*stuff' | awk '{FS="/" print $3---'}
> Is this what you mean?:
>
> find ./ -name '*stuff'|sed 's|\.[^/]*/[^/]*/||g'
If I have a directory path /stuff/stuff/more/stuff/more/and/more
that is n-levels deep, I want to be able to cut off the first two
levels and print the from 2 to the Nth level.
>
> Roland
> --
> R.F. Smith /"\ ASCII Ribbon Campaign
> r s m i t h @ x s 4 a l l . n l \ / No HTML/RTF in e-mail
> [url]http://www.xs4all.nl/~rsmith/[/url] X No Word docs in e-mail
> public key: [url]http://www.keyserver.net[/url] / \ Respect for open standards
--
David Bear
phone: 480-965-8257
fax: 480-965-9189
College of Public Programs/ASU
Wilson Hall 232
Tempe, AZ 85287-0803
"Beware the IP portfolio, everyone will be suspect of trespassing"
David Bear Guest
-
Mark Frank #3
Re: awk print
* On Wed, Feb 23, 2005 at 07:36:05PM -0700 David Bear wrote:
So how about cut?> On Wed, Feb 23, 2005 at 11:19:26PM +0100, Roland Smith wrote:>> > On Wed, Feb 23, 2005 at 02:40:10PM -0700, David Bear wrote:> >> > > I'm using awk to parse a directory listing. I was hoping there is a
> > > way to tell awk to print from $2 - to the end of the columns
> > > available.
> > >
> > > find ./ -name '*stuff' | awk '{FS="/" print $3---'}
> > Is this what you mean?:
> >
> > find ./ -name '*stuff'|sed 's|\.[^/]*/[^/]*/||g'
> thanks for the advice. No, this doesn't do what I want.
>
> If I have a directory path /stuff/stuff/more/stuff/more/and/more
> that is n-levels deep, I want to be able to cut off the first two
> levels and print the from 2 to the Nth level.
find ./ -name '*stuff'| cut -d/ -f4-
Mark
--
"The fix is only temporary...unless it works." - Red Green
Mark Frank Guest
-
Soheil Hassas Yeganeh #4
Re: awk print
You can set $[1..n] to "" and then print
find ./ -name "stuff" | awk '{ $1=""; $2=""; print}
On Wed, 23 Feb 2005 22:41:32 -0500, Mark Frank <mark@mark-and-erika.com> wrote:> * On Wed, Feb 23, 2005 at 07:36:05PM -0700 David Bear wrote:>> > On Wed, Feb 23, 2005 at 11:19:26PM +0100, Roland Smith wrote:> >> > > On Wed, Feb 23, 2005 at 02:40:10PM -0700, David Bear wrote:
> > > > I'm using awk to parse a directory listing. I was hoping there is a
> > > > way to tell awk to print from $2 - to the end of the columns
> > > > available.
> > > >
> > > > find ./ -name '*stuff' | awk '{FS="/" print $3---'}
> > >
> > > Is this what you mean?:
> > >
> > > find ./ -name '*stuff'|sed 's|\.[^/]*/[^/]*/||g'
> > thanks for the advice. No, this doesn't do what I want.
> >
> > If I have a directory path /stuff/stuff/more/stuff/more/and/more
> > that is n-levels deep, I want to be able to cut off the first two
> > levels and print the from 2 to the Nth level.
> So how about cut?
>
> find ./ -name '*stuff'| cut -d/ -f4-
>
> Mark
>
> --
> "The fix is only temporary...unless it works." - Red Green
> _______________________________________________
> [email]freebsd-questions@freebsd.org[/email] mailing list
> [url]http://lists.freebsd.org/mailman/listinfo/freebsd-questions[/url]
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
>Soheil Hassas Yeganeh Guest
-
FreeBSD questions mailing list #5
Re: awk print
On 24 feb 2005, at 12:39, Soheil Hassas Yeganeh wrote:
or if you insist on using awk:> You can set $[1..n] to "" and then print
> find ./ -name "stuff" | awk '{ $1=""; $2=""; print}
>
>
> On Wed, 23 Feb 2005 22:41:32 -0500, Mark Frank
> <mark@mark-and-erika.com> wrote:>> * On Wed, Feb 23, 2005 at 07:36:05PM -0700 David Bear wrote:>>>>> On Wed, Feb 23, 2005 at 11:19:26PM +0100, Roland Smith wrote:
>>>> On Wed, Feb 23, 2005 at 02:40:10PM -0700, David Bear wrote:
>>>>> I'm using awk to parse a directory listing. I was hoping there is a
>>>>> way to tell awk to print from $2 - to the end of the columns
>>>>> available.
>>>>>
>>>>> find ./ -name '*stuff' | awk '{FS="/" print $3---'}
>>>>
>>>> Is this what you mean?:
>>>>
>>>> find ./ -name '*stuff'|sed 's|\.[^/]*/[^/]*/||g'
>>>
>>> thanks for the advice. No, this doesn't do what I want.
>>>
>>> If I have a directory path /stuff/stuff/more/stuff/more/and/more
>>> that is n-levels deep, I want to be able to cut off the first two
>>> levels and print the from 2 to the Nth level.
>> So how about cut?
>>
>> find ./ -name '*stuff'| cut -d/ -f4-
>>
>> Mark
find ./ -name '*stuff' | awk '{for (i=3; i<=NF; i++) printf " %s", $i;
printf "\n" }'
Arno
FreeBSD questions mailing list Guest



Reply With Quote

