You could try something like:
If you want to try this on a Solaris/SunOS system, change awk to /usr/xpg4/bin/awk, /usr/xpg6/bin/awk, or nawk.
If you have a file named makefile that contains:
the script above will produce the output:
This User Gave Thanks to Don Cragun For This Post:
Hi All,
Can someone please help me write a script for the following requirement in awk, grep, sed or perl.
Buuuu xxx bbb
Kmmmm rrr ssss uuuu
Kwwww zzzz ccc
Roooowwww eeee
Bxxxx jjjj dddd
Kuuuu eeeee nnnn
Rpppp cccc vvvv cccc
Rhhhhhhyyyy tttt
Lhhhh rrrrrssssss
Bffff mmmm iiiii
Ktttt... (5 Replies)
We have the following statement working in CGYWIN, but when we move the program to Solaris 10 it fails.
x=`echo "ABC196925XYZ" | grep -o --only-matching "\{6\}"`
How can we use AWK or SED to extract only the number from the string?
The following outputs the entire string. We only want... (5 Replies)
Dear friends
I am new to linux and was trying to split some files userwise in our linux server.
I have a data file of 156 continuous columns named ecscr final.
I want the script to redirect all the lines containing a pattern of 7 digits to separate files. I was using grep to do that,... (2 Replies)
Hello All,
I have a file which is having below type of data,
Jul 19 2011 | 123456
Jul 19 2011 | 123456
Jul 20 2011 | 123456
Jul 20 2011 | 123456
Here I wanted to grep for date pattern as below, so that it should only grep "Jul 20" OR "Jul ... (9 Replies)
I have an array containing bunch of characters. I have to check this array for specific character and if "Not Found than" use a goto statement to go to USAGE
set options = (A B C D E F)
@ i = 0
while ($i <= ${#options})
if ($options != "F" || $options != "D") then
goto USAGE
endif
@... (1 Reply)
Hi,
I need a help to search a pattern and print the multiple lines between them.
Input file:
Tue May 29 12:30:33 EDT 2012:threadWebContainer : 357:com.travimp.hotelierlinks.abba.service.RequestHandler.requestService(String, ITICSDataSet): hotelCancelReservation request: ... (4 Replies)
Hi Experts,
Need help with the following:
Desired output:
Only want to get the output marked in green.
The file:
--- Physical volumes ---
PV Name /dev/disk/disk4704
PV Status available
Total PE 6399
Free PE ... (3 Replies)
Hi all!
Thanks for taking the time to view this!
I want to grep out all lines of a file that starts with pattern 1 but also does not match with the second pattern.
Example:
Drink a soda
Eat a banana
Eat multiple bananas
Drink an apple juice
Eat an apple
Eat multiple apples
I... (8 Replies)
The intended result should be :
PDF converters
'empty line'
gpdftext and pdftotext?xml version="1.0"?>
xml:space="preserve"><note-content version="0.1" xmlns:/tomboy/link" xmlns:size="http://beatniksoftware.com/tomboy/size">PDF converters
gpdftext and pdftotext</note-content>... (9 Replies)
I have this fileA
TEST FILE ABC
this file contains ABC;
TEST FILE DGHT this file contains DGHT;
TEST FILE 123
this file contains ABC,
this file contains DEF,
this file contains XYZ,
this file contains KLM
;
I want to have a fileZ that has only (begin search pattern for will be... (2 Replies)
Discussion started by: vbabz
2 Replies
LEARN ABOUT OSX
buildstrings
BuildStrings(1) BSD General Commands Manual BuildStrings(1)NAME
/usr/bin/BuildStrings -- Generate header (.h) or resource (.r) file from text files
SYNOPSIS
/usr/bin/BuildStrings [-define variable] [-header] [-attributes attributeList] [-type filekind] -id ResID -in path -out path
DESCRIPTION
The /usr/bin/BuildStrings command translates a text file into a resource or header file for use in localizing your Carbon application. The
input file is a series of newline-separated pairs of newline-separated strings. Each pair of strings represents the "base" string and the
localized equivalent. When generating a resource file, /usr/bin/BuildStrings generates a STR# resource containing only the localized equiva-
lents (which must be enclosed in double quotes in the source file). When generating the header file, /usr/bin/BuildStrings generates a C
header file with #define directives for each of the base strings (which must be valid C preprocessor symbols) equating each to the ordinal
number of the string in the STR# resource. Your C/C++ source code can use these preprocessor macros, along with standard Resource Manager
calls (like GetIndString) to load the appropriate localized string.
The source file may include #ifdef/#endif (or #ifndef/#endif) directives to conditionally include different pairs of strings, e.g. for debug-
ging builds or different versions. Note that these are the only preprocessor directives allowed in the source file.
When generating a resource file, you can set the resource ID and attributes of the STR# resource by providing /usr/bin/BuildStrings with the
appropriate command-line options.
You can use /usr/bin/BuildStrings with several different sets of strings in the same application, for example, error strings and warning
strings. The -type argument customizes some #defines in the generated header file so there are no conflicts.
The /usr/bin/BuildStrings command accepts the following arguments:
-header Generate a header file. If not provided, default is resource file format. Note that the file extension is not provided automati-
cally; your output file name must have the appropriate .h or .r extension.
-define variable
Defines variable for use in #ifdef or #ifndef conditionals. No value may be assigned to variable. This argument may be repeated
for any number of variables.
-id ResID
The resource ID for the STR# resource. There is no support for setting the resource name.
-attributes attribute
Resource attributes for the STR# resource definition (such as locked, preload, etc.) These are provided after the resource name in
the resource definition. This argument may be repeated for any number of attributes. It is ignored if generating a header.
-type filekind
Customizes three preprocessor variables (MinValidFoo, MaxValidFoo, FooRsrcID) #defined in a generated header file. Note that if
this argument is not provided, the default is the literal string "(null)", which will cause compile errors in the header file.
-in path
The input file, a set of newline-separated pairs of newline-separated strings. The first string of the pair is ignored for the
resource file (but is provided in a comment) and is used as the preprocessor symbol in the header file. The second string of the
pair is used as the resource string in the resource file and is ignored in the header file (but is provided in a comment), and must
be enclosed in double-quotes in your source file.
-out path
The output file. Note that you should provide the appropriate file extension; it is not provided automatically according to the
-header flag.
SEE ALSO Rez(1), DeRez(1)Mac OS X April 12, 2004 Mac OS X