I am new to shell scripting and programming. I am looking for a guide on how I can parse specific information from a plain text file with thousands of lines. Specifically I need to parse an email address from each line. The line looks something like this:
I would like to extract the email address (exluding the < and >) and then perform an update statement via mysql with the email address as a value.
Is there an example of this somewhere that I could use to base my needs off of?
What scripting tool would I use, how do I tell that tool to gab all contents BETWEEN the < and >?
How do I then (within one script) use this value to update a DB record?
p.s. I am essentially trying to unsubscribe these email addresses from a contact database..
Thanks for the help.
John
---------- Post updated at 01:19 PM ---------- Previous update was at 01:15 PM ----------
The SQL statement that needs to be run is:
Last edited by Scott; 11-19-2010 at 04:14 PM..
Reason: Please use code tags
I have a file with the following format
12g data/datasets/cct 8g data/dataset/cct
10 g data/two 5g data/something_different
10g something_different
5g data/two
is there a way to loop through this... (1 Reply)
Hey guys,
I have this file generated by me... i want to create some HTML output from it.
The problem is that i am really confused about how do I go about reading the file.
The file is in the following format:
TID1 Name1 ATime=xx AResult=yyy AExpected=yyy BTime=xx BResult=yyy... (8 Replies)
Hello guys,
should be a very easy questn for you:
I need to delete strings in file1 based on the list of strings in file2.
like file2:
word1_word2_
word3_word5_
word3_word4_
word6_word7_
file1:
word1_word2_otherwords..,word3_word5_others... (7 Replies)
The question is not as simple as the title... I have a file, it looks like this
<string name="string1">RZ-LED</string>
<string name="string2">2.0</string>
<string name="string2">Version 2.0</string>
<string name="string3">BP</string>
I would like to check for duplicate entries of... (11 Replies)
Dear all,
I have a data like below (n of rows=400,000) and I want to extract the rows with certain strings. I use code below. It works if there is not too many strings for example n of strings <5000. while I have 90,000 strings to extract. If I use the egrep code below, I will get error:
... (3 Replies)
Hello Everyone ,
Iam a newbie to shell programming and iam reaching out if anyone can help in this :-
I have two files
1) Insert.txt
2) partition_list.txt
insert.txt looks like this :-
insert into emp1 partition (partition_name)
(a1,
b2,
c4,
s6,
d8)
select
a1,
b2,
c4, (2 Replies)
I cannot seem to get what should be a simple awk one-liner to work correctly and cannot figure out why. I would like to use patterns from a specific field in one file as regex to search for matching strings in the entire line ($0) of another file.
I would like to output the lines of File2 which... (1 Reply)
Hello:
I have some text output, on SunOS 5.11 platform using KSH:
I am trying to parse out each string within the () for each line.
I tried, as example:
perl -lanF"" -e 'print "$F $F $F $F $F $F"'
But for some reason, the output gets all garbled after the the first fields.... (8 Replies)
Discussion started by: gilgamesh
8 Replies
LEARN ABOUT SUSE
alter_type
ALTER TYPE(7) SQL Commands ALTER TYPE(7)NAME
ALTER TYPE - change the definition of a type
SYNOPSIS
ALTER TYPE name RENAME TO new_name
ALTER TYPE name OWNER TO new_owner
ALTER TYPE name SET SCHEMA new_schema
DESCRIPTION
ALTER TYPE changes the definition of an existing type.
You must own the type to use ALTER TYPE. To change the schema of a type, you must also have CREATE privilege on the new schema. To alter
the owner, you must also be a direct or indirect member of the new owning role, and that role must have CREATE privilege on the type's
schema. (These restrictions enforce that altering the owner doesn't do anything you couldn't do by dropping and recreating the type. How-
ever, a superuser can alter ownership of any type anyway.)
PARAMETERS
name The name (possibly schema-qualified) of an existing type to alter.
new_name
The new name for the type.
new_owner
The user name of the new owner of the type.
new_schema
The new schema for the type.
EXAMPLES
To rename a data type:
ALTER TYPE electronic_mail RENAME TO email;
To change the owner of the type email to joe:
ALTER TYPE email OWNER TO joe;
To change the schema of the type email to customers:
ALTER TYPE email SET SCHEMA customers;
COMPATIBILITY
There is no ALTER TYPE statement in the SQL standard.
SQL - Language Statements 2010-05-14 ALTER TYPE(7)