I have many messages such as the test message below:
00:00000:00021:2002/05/13 13:57:00.51 ERROR:- Test error, my test error!!!
I am writing a script in which I need to get everything from the word "ERROR:-" onwards.
I normally use awk for these things, but I am not an expert at it so i am... (6 Replies)
Hi,
I know sed is stream text editor and not a bit more than that. Can anyone explain its usage and advantages?
How is awk different from sed?
I donno i am a bit confused about it. But i have coded in awk and shell.
Thanks,
Nisha
:confused: (7 Replies)
Hi there,
I'm trying to process a comma delimited file to remove the seconds:
916901,0,488589834,TRADE,Trade, ,2002-07-2510:14:43.387,CITI.MW,970847, , , ,808.0,2526.0,0.0,0.0,-1
So basically the .*** from the 7th field
Any help appreciated
Jon (4 Replies)
Hey all,
Can I put sed command inside the awk action ?? If not then can i do grep in the awk action ??
For ex:
awk '$1=="174" { ppid=($2) ; sed -n '/$ppid/p' tempfind.txt ; }' tempfind.txt
Assume: 174 is string.
Assume: tempfind.txt is used for awk and sed both.
tempfind.txt... (11 Replies)
Hi,
I have a data file with 5 columns - like this:
"20080401 09:43:08.770798 +0100s","TEST 1","R 1","A TEST","Nov 27 2007","1"
"20080401 09:43:08.770798 +0100s","THIS IS A TEST","R 2","B TEST","Nov 30 2007","10"
"20080401 09:43:08.770798 +0100s","ANOTHER TEST","R 3","B TEST","Nov 05... (7 Replies)
I've got an inventory database with eight columns with things like product name, manufacturer, UPC code, etc. on each line. Our PO (purchase order) number is in the first column. I can grep the date and get the full line of data but I would like to strip out everything but the PO number in the... (5 Replies)
What if I wanted to add a word such as IT after the first character and if theres 3 characters, after the 2nd character?
output would be:
G, it H
G, H it P
G, H, P it L
I'm thinking that AWK would be the easiest way to do this... Currently looking it up.
Right now I'm using awk but I... (13 Replies)
Hi All,
Is there a way of comparing two columns in the same file and deleting the row if the values of the columns match.
I have the sample data file as below.
M024900|175309.00|968.00|17
M025001|19861.79|97.90|148
M025002|431.70|159.00|3
M025003|912.30|159.90|6 ... (6 Replies)
Dear Geeks,
I want to manipulate a file with certain modifications for that using sed or AWK how to do this process for one file i have this type of data.
Input File:
"Restricted and Reserved names .ANISH",3798,"TEST.CO",1201208,6/16/10 0:00,6/16/13 0:00,,,"CO","2nd"^M
"Restricted and... (4 Replies)
Hi,
I am running a script sample.sh in bash environment .In the script i am using sed and awk commands which when executed individually from terminal they are getting executed normally but when i give these sed and awk commands in the script it is giving the below errors :-
./sample.sh: line... (12 Replies)
Discussion started by: satishmallidi
12 Replies
LEARN ABOUT OSX
setfile
SETFILE(1) BSD General Commands Manual SETFILE(1)NAME
/usr/bin/SetFile -- set attributes of files and directories
SYNOPSIS
/usr/bin/SetFile [-P] [-a attributes] [-c creator] [-d date] [-m date] [-t type] file ...
DESCRIPTION
/usr/bin/SetFile is a tool to set the file attributes on files in an HFS+ directory. It attempts to be similar to the setfile command in MPW.
It can apply rules to more than one file with the options applying to all files listed.
Flags:
-P Acts on a symlink file instead on the file the symlink resolves to.
-a attributes Sets the file attributes bits where attributes is a string of case sensitive letters. Each letter corresponds to a file
attribute: an uppercase letter indicates that the attribute bit is set (1), a lowercase letter indicates that it is not (0).
Note: attributes not specified remain unchanged.
A | a Alias file
B | b Has bundle
C | c Custom icon (allowed on folders)
D | d Located on the desktop (allowed on folders)
E | e Extension is hidden (allowed on folders)
I | i Inited - Finder is aware of this file and has given it a location in a window. (allowed on folders)
L | l Locked
M | m Shared (can run multiple times)
N | n File has no INIT resource
S | s System file (name locked)
T | t "Stationery Pad" file
V | v Invisible (allowed on folders)
Z | z Busy (allowed on folders)
-c creator Specifies the file's creator, where creator can be a string of four MacRoman characters, an empty string ('') designating a
null creator, or a binary, decimal, octal, or hexadecimal number in standard notation (e.g. 0x52486368).
-d date Sets the creation date, where date is a string of the form: "mm/dd/[yy]yy [hh:mm:[:ss] [AM | PM]]" Notes: Enclose the string
in quotation marks if it contains spaces. The date must be in the Unix epoch, that is, between 1/1/1970 and 1/18/2038. If the
year is provided as a two-digit year, it is assumed to be in the 21st century and must be from 00 (2000) through 38 (2038).
-m date Sets the modification date where date is a string of the form in -d above. (mm/dd/[yy]yy [hh:mm:[:ss] [AM | PM]])
-t type Sets the file type, where type can be a string of four MacRoman characters, an empty string ('') designating a null type, or a
binary, decimal, octal, or hexadecimal number in standard notation (e.g. 0x55455955).
RETURN VALUES
0 attributes set
1 syntax error
2 any other error
SEE ALSO GetFileInfo(1)EXAMPLES
This command line sets the modification date of "myFile":
SetFile -m "8/4/2001 16:13" myFile
Mac OS X January 4, 2009 Mac OS X