f



Changing xxxAxxxx to xxxBxxxxC

Hi all,

I am trying to modify a file of single word columns (no punctuation
etc.)
that requires the following substitution:

 xxxxA      ->     xxxxBC
 xxxAxxxx ->     xxxBxxxxC

that is check to see if the word contains string A and if it is at the
end,
replace it with BC; if it is in the middle, replace it with B and  add
C to the
end of the word.

The first one is easy enough, I guess I just search for "A_" and make
a
direct subst. The second case is a bit trickier.

Any suggestion would be appreciated,

Michuco

0
ibmichuco (27)
11/14/2007 7:12:34 PM
comp.lang.awk 3450 articles. 0 followers. Post Follow

10 Replies
3381 Views

Similar Articles

[PageSpeed] 25


On 11/14/2007 1:12 PM, ibmichuco@hotmail.com wrote:
> Hi all,
> 
> I am trying to modify a file of single word columns (no punctuation
> etc.)
> that requires the following substitution:
> 
>  xxxxA      ->     xxxxBC
>  xxxAxxxx ->     xxxBxxxxC
> 
> that is check to see if the word contains string A and if it is at the
> end,
> replace it with BC; if it is in the middle, replace it with B and  add
> C to the
> end of the word.
> 
> The first one is easy enough, I guess I just search for "A_" and make
> a
> direct subst. The second case is a bit trickier.
> 
> Any suggestion would be appreciated,
> 
> Michuco
> 

It's unclear exactly what your input file looks like and whether or not you want
to replace mumtiple occurences of "A", etc. but this may be what you want:

awk '{sub(/A$/,"BC")} gsub(/A/,"B"){$0=$0"C"} 1' file

If not, post some real sample input and expected output.

Regards,

	Ed.

0
Ed
11/14/2007 7:36:08 PM
Ed Morton wrote:
> On 11/14/2007 1:12 PM, ibmichuco@hotmail.com wrote:
> > Hi all,
> >
> > I am trying to modify a file of single word columns (no punctuation
> > etc.)
> > that requires the following substitution:
> >
> >  xxxxA      ->     xxxxBC
> >  xxxAxxxx ->     xxxBxxxxC
> >
> > that is check to see if the word contains string A and if it is at the
> > end,
> > replace it with BC; if it is in the middle, replace it with B and  add
> > C to the
> > end of the word.
> >
> > The first one is easy enough, I guess I just search for "A_" and make
> > a
> > direct subst. The second case is a bit trickier.
> >
> > Any suggestion would be appreciated,
> >
> > Michuco
> >
>
> It's unclear exactly what your input file looks like and whether or not you want
> to replace mumtiple occurences of "A", etc. but this may be what you want:
>
> awk '{sub(/A$/,"BC")} gsub(/A/,"B"){$0=$0"C"} 1' file
>
> If not, post some real sample input and expected output.
>
> Regards,
>
> 	Ed.

Well Ed, you're quick and you're good. Many thanks.
The sample file looks something like:

Ignore\t Ignore\t XXXXXAXXXX\t Ignore\t Ignore
Ignore\t Ignore\t XXXA\t               Ignore\t Ignore

The script you gave almost works, except that it add C to the
end of the line:

Ignore Ignore XXXXXBXXXX Ignore IgnoreC
Ignore Ignore XXXBC            Ignore Ignore

and it lost the tab FS. I would like to see

Ignore\t Ignore\t XXXXXBXXXXC\t Ignore\t Ignore
Ignore\t Ignore\t XXXBC\t               Ignore\t Ignore

So I changed $0 in your script to $3 and it works fine except
the tabs. Adding BEGIN {F = "\t"} didn't help.

Regards,

Michuco

0
ibmichuco
11/14/2007 8:32:05 PM

On 11/14/2007 2:32 PM, ibmichuco@hotmail.com wrote:
> Ed Morton wrote:
>
>>On 11/14/2007 1:12 PM, ibmichuco@hotmail.com wrote:
>>
>>>Hi all,
>>>
>>>I am trying to modify a file of single word columns (no punctuation
>>>etc.)
>>>that requires the following substitution:
>>>
>>> xxxxA      ->     xxxxBC
>>> xxxAxxxx ->     xxxBxxxxC
>>>
>>>that is check to see if the word contains string A and if it is at the
>>>end,
>>>replace it with BC; if it is in the middle, replace it with B and  add
>>>C to the
>>>end of the word.
>>>
>>>The first one is easy enough, I guess I just search for "A_" and make
>>>a
>>>direct subst. The second case is a bit trickier.
>>>
>>>Any suggestion would be appreciated,
>>>
>>>Michuco
>>>
>>
>>It's unclear exactly what your input file looks like and whether or not you want
>>to replace mumtiple occurences of "A", etc. but this may be what you want:
>>
>>awk '{sub(/A$/,"BC")} gsub(/A/,"B"){$0=$0"C"} 1' file
>>
>>If not, post some real sample input and expected output.
>>
>>Regards,
>>
>>	Ed.
>
>
> Well Ed, you're quick and you're good. Many thanks.
> The sample file looks something like:
>
> Ignore\t Ignore\t XXXXXAXXXX\t Ignore\t Ignore
> Ignore\t Ignore\t XXXA\t               Ignore\t Ignore

So your field separators are a single tab followed by a sequence of 1 or more
space characters "\t +"?

> The script you gave almost works, except that it add C to the
> end of the line:
>
> Ignore Ignore XXXXXBXXXX Ignore IgnoreC
> Ignore Ignore XXXBC            Ignore Ignore

That doesn't make sense. You'd have had to change it to this:

awk '{sub(/A\t/,"BC")} gsub(/A/,"B"){$0=$0"C"} 1' file

to get that output.

> and it lost the tab FS. I would like to see
>
> Ignore\t Ignore\t XXXXXBXXXXC\t Ignore\t Ignore
> Ignore\t Ignore\t XXXBC\t               Ignore\t Ignore
>
> So I changed $0 in your script to $3 and it works fine except
> the tabs. Adding BEGIN {F = "\t"} didn't help.

So, is it always $3 you want to operate on and do you care about preserving the
white space between fields or is it OK to change "\t     " to "\t " for example?

	Ed.

0
Ed
11/15/2007 4:15:37 AM
On Wed, 14 Nov 2007 12:32:05 -0800, ibmichuco@hotmail.com wrote:
>> On 11/14/2007 1:12 PM, ibmichuco@hotmail.com wrote:
<snip>
>> > I am trying to modify a file of single word columns (no punctuation
>> > etc.)
>> > that requires the following substitution:
>> >
>> >  xxxxA      ->     xxxxBC
>> >  xxxAxxxx ->     xxxBxxxxC
>> >
>> > that is check to see if the word contains string A and if it is at
>> > the end,
>> > replace it with BC; if it is in the middle, replace it with B and 
>> > add C to the
>> > end of the word.
<snip>
> <snip> The sample file
> looks something like:
> 
> Ignore\t Ignore\t XXXXXAXXXX\t Ignore\t Ignore Ignore\t Ignore\t XXXA\t 
>              Ignore\t Ignore
> 
<snip>
> <snip> I would like to see
> 
> Ignore\t Ignore\t XXXXXBXXXXC\t Ignore\t Ignore Ignore\t Ignore\t
> XXXBC\t               Ignore\t Ignore
<snip>

Hi Michuco, hello netlanders,

an awk-solution tested with gawk, mawk, and original-awk:

BEGIN { OFS = FS = "\t" }
{ for (i = 1; i <= NF; ++i) {
    if ($i ~ /A/) {
      gsub(/A/, "B", $i)
      $i = $i "C"
}  }  }
1

Enjoy it,

Steffen "goedel" Schuler
0
Steffen
11/16/2007 12:07:02 AM
On Fri, 16 Nov 2007 00:07:02 +0000, Steffen Schuler wrote:

> On Wed, 14 Nov 2007 12:32:05 -0800, ibmichuco@hotmail.com wrote:
>>> On 11/14/2007 1:12 PM, ibmichuco@hotmail.com wrote:
> <snip>
>>> > I am trying to modify a file of single word columns (no punctuation
>>> > etc.)
>>> > that requires the following substitution:
>>> >
>>> >  xxxxA      ->     xxxxBC
>>> >  xxxAxxxx ->     xxxBxxxxC
>>> >
>>> > that is check to see if the word contains string A and if it is at
>>> > the end,
>>> > replace it with BC; if it is in the middle, replace it with B and
>>> > add C to the
>>> > end of the word.
> <snip>
>> <snip> The sample file
>> looks something like:
>> 
>> Ignore\t Ignore\t XXXXXAXXXX\t Ignore\t Ignore Ignore\t Ignore\t XXXA\t
>>              Ignore\t Ignore
>> 
> <snip>
>> <snip> I would like to see
>> 
>> Ignore\t Ignore\t XXXXXBXXXXC\t Ignore\t Ignore Ignore\t Ignore\t
>> XXXBC\t               Ignore\t Ignore
<snip>
> an awk-solution tested with gawk, mawk, and original-awk:
> 
> BEGIN { OFS = FS = "\t" }
> { for (i = 1; i <= NF; ++i) {
>     if ($i ~ /A/) {
>       gsub(/A/, "B", $i)
>       $i = $i "C"
> }  }  }
> 1

Hi Michuco, hello netlanders,

a shorter awk script is:

BEGIN { OFS = FS = "\t" }
{ for (i = 1; i <= NF; ++i)
    if (gsub(/A/, "B", $i))
      $i = $i "C"
} 
1

Enjoy it,

Steffen "goedel" Schuler
0
Steffen
11/16/2007 12:39:35 AM
On Nov 15, 4:39 pm, Steffen Schuler <schuler.stef...@googlemail.com>
wrote:
> On Fri, 16 Nov 2007 00:07:02 +0000, Steffen Schuler wrote:
> > On Wed, 14 Nov 2007 12:32:05 -0800, ibmich...@hotmail.com wrote:
> >>> On 11/14/2007 1:12 PM, ibmich...@hotmail.com wrote:
> > <snip>
> >>> > I am trying to modify a file of single word columns (no punctuation
> >>> > etc.)
> >>> > that requires the following substitution:
>
> >>> >  xxxxA      ->     xxxxBC
> >>> >  xxxAxxxx ->     xxxBxxxxC
>
> >>> > that is check to see if the word contains string A and if it is at
> >>> > the end,
> >>> > replace it with BC; if it is in the middle, replace it with B and
> >>> > add C to the
> >>> > end of the word.
> > <snip>
> >> <snip> The sample file
> >> looks something like:
>
> >> Ignore\t Ignore\t XXXXXAXXXX\t Ignore\t Ignore Ignore\t Ignore\t XXXA\t
> >>              Ignore\t Ignore
>
> > <snip>
> >> <snip> I would like to see
>
> >> Ignore\t Ignore\t XXXXXBXXXXC\t Ignore\t Ignore Ignore\t Ignore\t
> >> XXXBC\t               Ignore\t Ignore
> <snip>
> > an awk-solution tested with gawk, mawk, and original-awk:
>
> > BEGIN { OFS = FS = "\t" }
> > { for (i = 1; i <= NF; ++i) {
> >     if ($i ~ /A/) {
> >       gsub(/A/, "B", $i)
> >       $i = $i "C"
> > }  }  }
> > 1
>
> Hi Michuco, hello netlanders,
>
> a shorter awk script is:
>
> BEGIN { OFS = FS = "\t" }
> { for (i = 1; i <= NF; ++i)
>     if (gsub(/A/, "B", $i))
>       $i = $i "C"}
>
> 1
>
> Enjoy it,
>
> Steffen "goedel" Schuler

This is a real newbie question -- why the "1" at the end of this
script and Ed's?
0
Sammy
11/16/2007 1:38:39 AM
On Fri, 16 Nov 2007 00:39:35 +0000, Steffen Schuler wrote:

> On Fri, 16 Nov 2007 00:07:02 +0000, Steffen Schuler wrote:
> 
>> On Wed, 14 Nov 2007 12:32:05 -0800, ibmichuco@hotmail.com wrote:
>>>> On 11/14/2007 1:12 PM, ibmichuco@hotmail.com wrote:
>> <snip>
>>>> > I am trying to modify a file of single word columns (no punctuation
>>>> > etc.)
>>>> > that requires the following substitution:
>>>> >
>>>> >  xxxxA      ->     xxxxBC
>>>> >  xxxAxxxx ->     xxxBxxxxC
>>>> >
>>>> > that is check to see if the word contains string A and if it is at
>>>> > the end,
>>>> > replace it with BC; if it is in the middle, replace it with B and
>>>> > add C to the
>>>> > end of the word.
>> <snip>
>>> <snip> The sample file
>>> looks something like:
>>> 
>>> Ignore\t Ignore\t XXXXXAXXXX\t Ignore\t Ignore Ignore\t Ignore\t
>>> XXXA\t
>>>              Ignore\t Ignore
>>> 
>> <snip>
>>> <snip> I would like to see
>>> 
>>> Ignore\t Ignore\t XXXXXBXXXXC\t Ignore\t Ignore Ignore\t Ignore\t
>>> XXXBC\t               Ignore\t Ignore
> <snip>
>> an awk-solution tested with gawk, mawk, and original-awk:
>> 
>> BEGIN { OFS = FS = "\t" }
>> { for (i = 1; i <= NF; ++i) {
>>     if ($i ~ /A/) {
>>       gsub(/A/, "B", $i)
>>       $i = $i "C"
>> }  }  }
>> 1
<snip>
> a shorter awk script is:
> 
> BEGIN { OFS = FS = "\t" }
> { for (i = 1; i <= NF; ++i)
>     if (gsub(/A/, "B", $i))
>       $i = $i "C"
> }
> 1

Hi Michuco, hello netlanders,

still a bit shorter, but works only with gawk:

BEGIN          { RS = "[\t\n]"      }
gsub(/A/, "B") { sub(/$/, "C")      }
               { printf "%s", $0 RT }

Enjoy it,

Steffen "goedel" Schuler


0
Steffen
11/16/2007 1:49:39 AM
On Thu, 15 Nov 2007 17:38:39 -0800, Sammy wrote:

> On Nov 15, 4:39 pm, Steffen Schuler <schuler.stef...@googlemail.com>
<snip>
>> a shorter awk script is:
>>
>> BEGIN { OFS = FS = "\t" }
>> { for (i = 1; i <= NF; ++i)
>>     if (gsub(/A/, "B", $i))
>>       $i = $i "C"}
>>
>> 1
<snip>
> 
> This is a real newbie question -- why the "1" at the end of this script
> and Ed's?

Hello Sammy, hello netlanders,

1 is an always true condition.

If a rule consists only of a condition COND, it is an abbreviation for

COND { print $0 }

So the rule consisting only of the condition 1 means: print always the 
currrent line/record.

Instead of 1 you can also use any number or string value different from 0 
or "" e.g. 9. (0 or "" means false)

Hope I could help,

Steffen "goedel" Schuler
0
Steffen
11/16/2007 2:05:47 AM
Sammy escreveu:
[snipped]
> 
> This is a real newbie question -- why the "1" at the end of this
> script and Ed's?

AWK has statements composed of PATTERNS and ACTIONS.

Pattern-Action statements are evaluated in turn for each input RECORD 
(for most practical purposes we could say 'lines of text' here).

So an example would be:

$3 < 10 { print $3}

which means "if the third FIELD of the RECORD being scanned is less than 
ten print it".

When the logical evaluation of PATTERN is true, ACTION is executed.

It happens that the syntax of AWL language has some defaults, so:

if I wanted that instead of printing _only_ the third field, the whole 
record (line) was printed I could change to:

$3 < 10 { print $0}

but it can be simplified to:

$3 < 10 { print}

in fact if the ACTION part is only "print", one can simplify even further:

$3 < 10

If I wanted to print every line, the thing I need to do is to ascertain 
the pattern always true.

The "1" does it and it is very compact.

HTH

--
Cesar Rabak
0
Cesar
11/16/2007 3:14:39 AM

Ed Morton wrote:
> On 11/14/2007 2:32 PM, ibmichuco@hotmail.com wrote:
> > Ed Morton wrote:
> >
> >>On 11/14/2007 1:12 PM, ibmichuco@hotmail.com wrote:
> >>
> >>>Hi all,
> >>>
> >>>I am trying to modify a file of single word columns (no punctuation
> >>>etc.)
> >>>that requires the following substitution:
> >>>
> >>> xxxxA      ->     xxxxBC
> >>> xxxAxxxx ->     xxxBxxxxC
> >>>
> >>>that is check to see if the word contains string A and if it is at the
> >>>end,
> >>>replace it with BC; if it is in the middle, replace it with B and  add
> >>>C to the
> >>>end of the word.
> >>>
> >>>The first one is easy enough, I guess I just search for "A_" and make
> >>>a
> >>>direct subst. The second case is a bit trickier.
> >>>
> >>>Any suggestion would be appreciated,
> >>>
> >>>Michuco
> >>>
> >>
> >>It's unclear exactly what your input file looks like and whether or not you want
> >>to replace mumtiple occurences of "A", etc. but this may be what you want:
> >>
> >>awk '{sub(/A$/,"BC")} gsub(/A/,"B"){$0=$0"C"} 1' file
> >>
> >>If not, post some real sample input and expected output.
> >>
> >>Regards,
> >>
> >>	Ed.
> >
> >
> > Well Ed, you're quick and you're good. Many thanks.
> > The sample file looks something like:
> >
> > Ignore\t Ignore\t XXXXXAXXXX\t Ignore\t Ignore
> > Ignore\t Ignore\t XXXA\t               Ignore\t Ignore
>
> So your field separators are a single tab followed by a sequence of 1 or more
> space characters "\t +"?
>
> > The script you gave almost works, except that it add C to the
> > end of the line:
> >
> > Ignore Ignore XXXXXBXXXX Ignore IgnoreC
> > Ignore Ignore XXXBC            Ignore Ignore
>
> That doesn't make sense. You'd have had to change it to this:
>
> awk '{sub(/A\t/,"BC")} gsub(/A/,"B"){$0=$0"C"} 1' file
>
> to get that output.
>
> > and it lost the tab FS. I would like to see
> >
> > Ignore\t Ignore\t XXXXXBXXXXC\t Ignore\t Ignore
> > Ignore\t Ignore\t XXXBC\t               Ignore\t Ignore
> >
> > So I changed $0 in your script to $3 and it works fine except
> > the tabs. Adding BEGIN {F = "\t"} didn't help.
>
> So, is it always $3 you want to operate on and do you care about preserving the
> white space between fields or is it OK to change "\t     " to "\t " for example?
>
> 	Ed.

Hi,

The space after the taqb is not important, actually it has something
to do with
Google News. Sorry, don't have much of an option beside Google News.

I was able to slightly twist your script to do what I needed. Again,
thanks to Ed and
others for your quick help.

Michuco
0
ibmichuco
11/16/2007 7:20:19 PM
Reply:

Similar Artilces:

DST to change or not to change?
Should the clocks be changed twice a year or not? (not that we have much say in the matter) Some think it saves lives by avoiding traffic accidents and note the advantages of a coordinated timekeeping system for trade. http://www.theglobeandmail.com/servlet/story/RTGAM.20050811.wdaylight0810/BNStory/National Since most of Canada is between north latitude 49 deg to 90 deg, and the days and nights are longer the further north you go, the arguments for saving daylight seem to be overwhelmed by the larger natural changes. OTOH DST is not needed at smaller latitudes in the tropics. ...

how to change the change defaults
hi friends, it might be a stupid question to state. but i really need to know while programming, to change the defaults like changing the engineering notation of a real quantity i.e. fraction values or change the fix parameters to denote real value if our calculations involve the values as low as 0.000000001 and as high as 10000000. thanks hemu bisht ...

Changing AWK indent behavior in VIM 7.
I recently upgraded to VIM 7. It was a "voluntary" upgrade and there are some nice features that attracted me. However, one thing that is annoying is the way it handles autoindent when writing AWK code. Previously, it "just worked". What I think happened is that TPTB decided to take the cindent conventions and extend them to other non-C, but C-like languages (e.g., AWK). Now, in one sense, this could be a good thing, but my conventions for writing code are different that what TPTB think is standard. I've never liked the way VIM does C indenting, but since I...

how to change the LANG envirement value for the ftpd server #3
hello,all We have a HP-UNIX 11 and have simple chinese language support.It seems the system default LANG is simple chinese. The cde default language is chinese and inetd is chinese too since the ftpd server LANG is chinese. So where the default LANG is set? But while I login as root, the locale command output is as below: LANG= LC_CTYPE="C" LC_COLLATE="C" LC_MONETARY="C" LC_NUMERIC="C" LC_TIME="C" LC_MESSAGES="C" LC_ALL= it seems the normal value. And there is no relevant envirement value set in /.profile file. So why root'...

AWK bug? Changing one field affects output delimiter
Hi, This seems a bug to me because I think changing one field should not affect the input/output field separators. But my current awk does: My test file: $ cat $tf.tst | tee /dev/tty | od -t x1 Ssssss Ffff 777 2222 fssssss@somewhere.org 0000000 53 73 73 73 73 73 09 46 66 66 66 09 37 37 37 09 0000020 32 32 32 32 09 66 73 73 73 73 73 73 40 73 6f 6d 0000040 65 77 68 65 72 65 2e 6f 72 67 20 0a First test: $ cat $tf.tst | awk -F'\t' '{uid=$5; printf NR "\t" uid "\t"; print}' | od -t x1 0000000 31 09 66 73 73 73 73 73 73 40 73 6f 6d 65 77 68 00000...

Why xml:lang instead of lang?
What was the reason to introduce a new attribute "xml:lang" instead of "lang"? This bothers both authors and browsers in different language versions: HTML 4, XHTML 1.0, XHTML 1.1. HTML has only "lang"; XHTML 1.1 has only "xml:lang"; XHTML 1.0 has both! For example, Mozilla 1.7 recognizes the lang attribute http://www.unics.uni-hannover.de/nhtcapri/temp/lang-attribute.htm but it does not recognize the xml:lang attribute. http://www.unics.uni-hannover.de/nhtcapri/temp/lang-attribute.xhtml What do we gain from "xml:lang"? Andreas Prilop wrote: > What was the reason to introduce a new attribute "xml:lang" > instead of "lang"? > What do we gain from "xml:lang"? By putting the attribute in the general and predefined namespace http://www.w3.org/XML/1998/namespace it can be used by any XML application (e.g. XHTML, SVG) without any further effort and without any danger of colliding with attributes in no namespace a particular XML application might want to define. -- Martin Honnen http://JavaScript.FAQTs.com/ Andreas Prilop wrote: > What was the reason to introduce a new attribute "xml:lang" > instead of "lang"? Since it is useful to have a means of describing language in the core of XML. It only looks silly from an (X)HTML-centric viewpoint. -- David Dorward http://dorward.me.uk/ In article <Pine.GSO.4.44.0603311415390.8640-100000@s5b004.rrzn.u...

Re: Changes and frequency of changes
On Sat, 28 Apr 2007 15:08:15 -0400, mcolowasth@YAHOO.CO.UK wrote: >Hi, > >I observe variable x over time (from 1999-2005) for a large number of >firms, w. I have computed the change in variable x from one year to the >next. > >Now, I would like to identify whether variable x has changed from one year >to the next for each firm as well as how often it changed for each firm(in >some cases I expect no change in this variable i.e. 0). > >Any suggestions on how to do this in sas? > >Thanks Generate test data, since original poster did not provide it: data observed; do firm = 'a', 'b'; do year = 1999 to 2005; x = 2 + round(ranuni(135),0.3); output; end; end; run; Result: Obs firm year x 1 a 1999 2.9 2 a 2000 2.9 3 a 2001 2.9 4 a 2002 2.0 5 a 2003 2.3 6 a 2004 2.9 7 a 2005 2.3 8 b 1999 2.9 9 b 2000 2.6 10 b 2001 2.9 11 b 2002 2.6 12 b 2003 2.6 13 b 2004 2.3 14 b 2005 2.0 Here is a solution with a couple of dorfmanic touches: data whether (keep = firm year x whether) howoften (keep = firm howoften) ; set observed; by firm; changed = not not dif(fuzz(x) ); if first.firm then howoften = 0; else do; ...

How to Manage the Change within the Change?
How can we manage change to software that is not completely tested? For example: For a fictitious name I will use "Big Company Software" (BCS) 1.01.00. Each month BCS goes through the following cycle: Evaluate and Accept Customer Requests Plan Design Develop Build Test User Test Deployment So for example in month 1 BCS 1.01.00 is released. On month 2 BCS 1.02.00 is released etc. Also for example the evaluation, plan, design and development takes place in the first 20 days of the month and test/ user test takes place in the last 10. But on month 2, on day 5 for...

icon changes with change of extension
when we change the extension of a file in windows, its icon also changes..... how does windows do tht. in my application i require a similar approach. i want the icon to be dependent on the file extension not on the attributes of the file. i have gone trough the registry but things are not very clear. Windows has listed all the file extensions avaliable there, but there is no general way to extract icons for those extension... kindly help Windows displays the icon of the program associated with the file, so if you change a file from ".doc" to ".txt" then the...

how to change the change defaults #2
hi friends, it might be a stupid question to state. but i really need to know while programming, to change the defaults like changing the engineering notation of a real quantity i.e. fraction values or change the fix parameters to denote real value if our calculations involve the values as low as 0.000000001 and as high as 10000000. thanks hemu bisht ...

awk correct tool? (search file, change value based on input)
I have a file (status.file) of the form: valueA 3450 valueB -20 valueC -340 valueD 48 I am tailing a data.file, and need to search and modify a value in status.file...the tail is: tail -f data.file | awk '{ print $3, ($NF - $(NF-1)) }' which will produce lines that look like this: valueB -40 valueD 220 valueA -100 so I think what I would like to do is add a pipe to the tail command, and send those lines to an awk command/program. It should then search through status.file, and add the value to the correct line. For example, using the above status.file, a line of data (after havin...

awk
I'd like if it's possible to use awk in strqsh mode . Thanks Running Awk: http://www.itjungle.com/mgo/mgo011503-story02.html and http://www.omniuser.org/Downloads/Qshell-OpenSSH-OMNI.pdf On 21 Giu, 23:56, "Emile" <em...@e.nl> wrote: > Running Awk: > > http://www.itjungle.com/mgo/mgo011503-story02.html > > and > > http://www.omniuser.org/Downloads/Qshell-OpenSSH-OMNI.pdf=A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 Now I need to use strqsh mode; I use awk in strqsh mode adding to $PATH environment variable the path /QOpenSys/usr/bin, but when (in awk) I use system() function the envvar $PATH was not inherited but it assumes the value /QOpenSys/usr/bin:/usr/ccs/bin:/QOpenSys/usr/bin/X11:/usr/sbin:.:/usr/ bin instead when I use awk in PASE mode (call qp2term) the path in system() was inherited correctly. On 22 Giu, 09:40, "frenk...@hotmail.com" <frenk...@hotmail.com> wrote: > On 21 Giu, 23:56, "Emile" <em...@e.nl> wrote: > > > Running Awk: > > >http://www.itjungle.com/mgo/mgo011503-story02.html > > > and > > >http://www.omniuser.org/Downloads/Qshell-OpenSSH-OMNI.pdf=A0=A0 =A0 =A0 = =A0 =A0 =A0 =A0 > > Now I need to use strqsh mode; > I use awk in strqsh mode adding to $PATH environment variable the > path =A0/QOpenSys/usr/bin, > but when (in awk) I use system() function the envvar $PATH was not > inherited but it assumes the value ...

awk
I have the following gawk script that I came up with on my linux box that works and I'd like to be able to use it on my iBook but from the manpage for awk the FIELDWIDTH variable isn't supported. Can the script be easily converted to awk from gawk? Or should I look for a gawk implementation for OSX? { FIELDWIDTHS = "7 22 9 7 18 48 8 25 7 3 15 1 2 2 2 2 2 2 2 2 2 30" } { print $1, ";", $2, ";", $3, ";", $4, ";", $5, ";" $7, ";", $8} I know the length of each field, but the fields aren't necessarially sepera...

AWK
hi, I am having following txt file. ------------------------------------------------------------------- 00032 Clemson Univ, Howard , Dept Chem, Clemson, SC 29634 USA. 00032 Clemson Univ, Howard , Films, Clemson, SC 29634 USA. 10032 Oak Ridge Natl Lab, High , Oak Ridge, TN 37831 USA. 12029 Oak Ridge Natl Lab, Oak Ridge, TN 37831 USA. 00029 Univ Texas, Dept Phys, Austin, TX 78712 USA. ------------------------------------------------------------------ i want output in following manner. 00032 Clemson Univ 00032 Clemson Univ 10032 Oak Ridge Nat1 Lab 12029 Oak Ridge Nat1 Lab 000...

awk
grep Glen ~/Check| awk -F " " "{ print $1 }" I have a file filled with name separated by spaces how can i edit the line above to split by space James wrote: > grep Glen ~/Check| awk -F " " "{ print $1 }" > > I have a file filled with name separated by spaces how can i edit the line > above to split by space Not sure I read your question correctly, but how about something like: jc@soyuz:/tmp$ awk 'BEGIN { FS=" " } { print $2 "," $1 }' << EOT > John Glenn > Buzz Aldrin > EOT Glenn,John Aldrin,Buz...

lang
fortran ...

awk
Why in the following code? varA=2; strA="`cat /root/mytempdir/wordlist.txt | awk '{print $ 2}'`" strB="`cat /root/mytempdir/wordlist.txt | awk '{print $ $varA}'`" strA contains the second word of line 1 and strB contains all line 1 ??? Thanks AL wrote: > Why in the following code? > > varA=2; > > strA="`cat /root/mytempdir/wordlist.txt | awk '{print $ 2}'`" > strB="`cat /root/mytempdir/wordlist.txt | awk '{print $ $varA}'`" > > strA contains the second word of line 1 > and strB contains...

new at "awk.info": SQL Awk; embedding Awk in "C"; and more
Here are the recent updates to http://awk.info . (For all updates to awk.info, subscribe to http://tinyurl.com/rss4awk. To contribute to awk.info, see http://awk.info/?contribute .) ----------------------------------------------------------- NEWS Inteview with Aharon Robbins. - http://awk.info/?news/robbinsTalks Ed Morton shows how to print ranges within an input file. - http://awk.info/?tip/printranges Janis Papanagnou shows how to use header names to reference column data. - http://awk.info/?tip/readheaders Tibor Palinkas shows how to embed Awk inside "C". - http://awk.info/?...

A Lange & Sohne Lange 1 Watches: Quality A Lange & Sohne Discount Watches
A Lange & Sohne Lange 1 Watches: Quality A Lange & Sohne Discount Watches Quality A Lange & Sohne Lange 1 Watches http://a-lange-sohne-watches.pxhelp.com/a-lange-sohne-lange-1.html Thank you for choosing http://www.pxhelp.com/ Discount A Lange & Sohne Watches http://a-lange-sohne-watches.pxhelp.com/ We guarantee our A Lange & Sohne Lange 1 Watches and A Lange & Sohne Lange 1 Luxury Watches aren't just a simple imitation. We use the same fine materials and technology that the original does. Each A Lange & Sohne Lange 1 Watch produced is examined carefully by ...

new at "awk.info": SQL Awk; embedding Awk in "C"; and more #2
Here are the recent updates to http://awk.info . (For all updates to awk.info, subscribe to http://tinyurl.com/rss4awk. To contribute to awk.info, see http://awk.info/?contribute .) ----------------------------------------------------------- NEWS Inteview with Aharon Robbins. - http://awk.info/?news/robbinsTalks Ed Morton shows how to print ranges within an input file. - http://awk.info/?tip/printranges Janis Papanagnou shows how to use header names to reference column data. - http://awk.info/?tip/readheaders Tibor Palinkas shows how to embed Awk inside "C". - http://awk.info/?...

A Lange & Sohne Grand Lange 1 Watches: Quality A Lange & Sohne Discount Watches
A Lange & Sohne Grand Lange 1 Watches: Quality A Lange & Sohne Discount Watches Quality A Lange & Sohne Grand Lange 1 Watches http://a-lange-sohne-watches.pxhelp.com/a-lange-sohne-grand-lange-1.html Thank you for choosing http://www.pxhelp.com/ Discount A Lange & Sohne Watches http://a-lange-sohne-watches.pxhelp.com/ We guarantee our A Lange & Sohne Grand Lange 1 Watches and A Lange & Sohne Grand Lange 1 Luxury Watches aren't just a simple imitation. We use the same fine materials and technology that the original does. Each A Lange & Sohne Grand Lange 1 Watc...

Changing a drop list after dictionary change
I added a few drop lists on forms, when the item was a char 6 field. Then I changed the dictionary so that it was s10. But I can't figure out how to manually make the drop list change format. The generated code still says s5: LIST,AT(113,34,60,10),USE(CAB:End1,,?CAB:End1:2),FORMAT('20L(2)|M~End Code~@s5@'),DROP(10),FROM(CAB:End2MF) However, doing a synchronize - does fix it. Dear Bob, > I added a few drop lists on forms, when the item was a char 6 field. > Then I changed the dictionary so that it was s10. But I can't figure > out how to manually make the drop li...

Changing driver for one user changes it for all.
This is so odd to me. I'm googling for references but have had no luck so far. At one company, we have about a dozen people (on Windows XP) using the same Xerox printer. Everyone accesses the printer as a local printer on an IP port. We downloaded a new driver but wanted to roll it out carefully. I installed it on the admin machine by entering the Printer Properties, Advanced tab, New Driver and made sure that the new driver was selected in the "Driver" drop down. It turns out that changing the driver in this drop down changes it for everyone!! It wiped out saved settings too. Question 1: Is this correct behaviour? Are these drivers associated with the physical printer in some way? Question 2: Is it possible to have two users with different drivers? I just tried the same thing on a different network and this did not happen. Is this a Xerox thing? I am not at the company where this happened right now so I can't experiment. Thanks for your time. ..wk. ...

Why do imagettfbbox coordinates change when angle changes?
Hi, I'm using php 4.4.4. Maybe I'm misreading the docs, but in the imagettfbbox manual (http://us2.php.net/imagettfbbox), it says that text coordinates are the same regardless of what the angle is. But I am getting two distinct sets of coordinates if I change the angle from zero to 270. Here's the relevant code: $text = "hello"; $s = getImageSize($img_file); $imgWidth = $s[0]; $imgHeight = $s[1]; $source=ImageCreateFromJPEG($img_file); $size=16; $black=imagecolorallocate($source,0,0,0); $font='/usr/share/fonts/msttcorefonts/times.ttf'; $bbox=imagettfbbox($size,$angle,$font,$text); $textWidth=$bbox[2]-$bbox[0]; $textHeight=$bbox[5]-$bbox[3]; $x=($imgWidth/2)-($textWidth/2); $y=($imgHeight/2)-($textHeight/2); imagettftext($source,$size,$angle,$x,$y,$black,$font,$text ); header("Content-type: image/jpeg"); When I print out the bbox with 0, I get Array ( [0] => -3 [1] => -1 [2] => 41 [3] => -1 [4] => 41 [5] => -16 [6] => -3 [7] => -16 ) with 270, I get Array ( [0] => -13 [1] => -1 [2] => -13 [3] => 41 [4] => -1 [5] => 41 [6] => -1 [7] => -1 ) I must be misinterpreting the docs. Why are the coordinates different? - Dave On Thu, 13 Mar 2008 18:18:13 +0100, laredotornado@zipmail.com = <laredotornado@zipmail.com> wrote: > I'm using php 4.4.4. Maybe I'...

Web resources about - Changing xxxAxxxx to xxxBxxxxC - comp.lang.awk

Resources last updated: 3/19/2016 5:15:32 PM