08-10-2012
Cut Lines using grep
Hi,
I have a SQL script with "create table" and "alter table" statements and I want to cut all the alter table statements from original file (A) and move it to a different file (B).
Can you please me the option. Thanks a lot for your time.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi,
i have a simple question:
in hpux 11i;
this cmd :
cat mailtest |grep sekar >test1
gives the output file with the name test1.
i want to remove the line which contains the "sekar" and put the result in the new file....
what is the command for that?.. (2 Replies)
Discussion started by: sekar sundaram
2 Replies
2. Shell Programming and Scripting
Hi
Is there a way to cut the last two characters off a word or number given that this word or number can be of varying length?
I have tried something like
TEST=`echo $OLD | cut -c 1-5`
where $OLD is a variable containing a number like 1234567 which gives a result of 12345. This is fine... (4 Replies)
Discussion started by: rleebife
4 Replies
3. Shell Programming and Scripting
Hello all,
I have some weird problem that kinda baffles me. Say I have the following test file:
claudia:~/tmp$ cat testfile.txt
This is a test line
This is the second test line
And yeah, this is the third test line
Then say I want to tail the file, grep for the word "third" then... (7 Replies)
Discussion started by: sylaan
7 Replies
4. UNIX for Dummies Questions & Answers
Hello folks,
I have to (e)grep out a certain pattern e.g. <TAG1> from a huge log file which does not have any space as such.
The thing is that once I have 'grep'ed out the <TAG1> from the file I need to extract the content within the tags, i.e,
<TAG1>Data_To_Be_Extracted</TAG1>
The underlined... (9 Replies)
Discussion started by: Rajat
9 Replies
5. Shell Programming and Scripting
Hi
My input file looks like as follows: say a.txt
"aaaa cc","224 AW","ss cccccc","P06 09/10","dddddd"
"aaaa cc","224 AW","ss cccccc","P06 09/10","dddddd"
"aaaa cc","224 AW","ss cccccc","P06 09/10","dddddd"
"aaaa cc","224 AW","ss cccccc","P06 09/10","dddddd"
"aaaa cc","224 AW","ss... (5 Replies)
Discussion started by: bittoo
5 Replies
6. Shell Programming and Scripting
Hi folks
I am not allowed to install GNU grep on AIX.
Here my code excerpt:
grep_fatal () {
/usr/sfw/bin/gegrep -B4 -A2 "FATAL|QUEUE|SIGHUP"
}
Howto the same on AIX based machine?
from manual GNU grep
‘--after-context=num’
Print num lines of trailing context after... (4 Replies)
Discussion started by: slashdotweenie
4 Replies
7. Slackware
not sure how to do it. wan't to delete it using cut and grep ince i would use it in the shell.
but how must the command be?
grep "64.233.181.103 wwwGoogle.com" /etc/hosts | cut -d
the delimeter is just a space. can you help meplease. :D (1 Reply)
Discussion started by: garfish
1 Replies
8. Shell Programming and Scripting
Hi,
my xml files looks something like this
<Instance Name="New York">
<Description></Description>
<Instance Name="A">
<Description></Description>
<PropertyValue Key="false" Name="Building A" />
</Instance>
<Instance Name="B">
... (4 Replies)
Discussion started by: tententen
4 Replies
9. Shell Programming and Scripting
This is my command-line code in my script,
passwd=`grep $passwd $userfile | cut -f2 -d: login_users > retrieve`
the
cut -f2 -d: login_users > retrieve
searches and prints the whole column two. what I need is one of the items in the column two only.. what option can I add to my cut... (2 Replies)
Discussion started by: jenimesh19
2 Replies
10. UNIX for Dummies Questions & Answers
All,
I would like to cut all the lines from the log file for the timestamp . I'm not clear about how to apply grep ,awk here.Can you help me on this ?
My logfile:
**********
Wed Feb 20 03:48:26 2013
Thread 1 advanced to log sequence 400 (LGWR switch)
Thu Feb 21 02:34:23 2013... (1 Reply)
Discussion started by: arul1185
1 Replies
LEARN ABOUT DEBIAN
sql::translator::producer::mysql
SQL::Translator::Producer::MySQL(3pm) User Contributed Perl Documentation SQL::Translator::Producer::MySQL(3pm)
NAME
SQL::Translator::Producer::MySQL - MySQL-specific producer for SQL::Translator
SYNOPSIS
Use via SQL::Translator:
use SQL::Translator;
my $t = SQL::Translator->new( parser => '...', producer => 'MySQL', '...' );
$t->translate;
DESCRIPTION
This module will produce text output of the schema suitable for MySQL. There are still some issues to be worked out with syntax
differences between MySQL versions 3 and 4 ("SET foreign_key_checks," character sets for fields, etc.).
ARGUMENTS
This producer takes a single optional producer_arg "mysql_version", which provides the desired version for the target database. By default
MySQL v3 is assumed, and statements pertaining to any features introduced in later versions (e.g. CREATE VIEW) are not produced.
Valid version specifiers for "mysql_version" are listed here
Table Types
Normally the tables will be created without any explicit table type given and so will use the MySQL default.
Any tables involved in foreign key constraints automatically get a table type of InnoDB, unless this is overridden by setting the
"mysql_table_type" extra attribute explicitly on the table.
Extra attributes.
The producer recognises the following extra attributes on the Schema objects.
field.list
Set the list of allowed values for Enum fields.
field.binary, field.unsigned, field.zerofill
Set the MySQL field options of the same name.
field.renamed_from, table.renamed_from
Use when producing diffs to indicate that the current table/field has been renamed from the old name as given in the attribute value.
table.mysql_table_type
Set the type of the table e.g. 'InnoDB', 'MyISAM'. This will be automatically set for tables involved in foreign key constraints if it
is not already set explicitly. See "Table Types".
Please note that the "ENGINE" option is the preferred method of specifying the MySQL storage engine to use, but this method still works
for backwards compatibility.
table.mysql_charset, table.mysql_collate
Set the tables default charater set and collation order.
field.mysql_charset, field.mysql_collate
Set the fields charater set and collation order.
SEE ALSO
SQL::Translator, http://www.mysql.com/.
AUTHORS
darren chamberlain <darren@cpan.org>, Ken Youens-Clark <kclark@cpan.org>.
perl v5.14.2 2012-01-18 SQL::Translator::Producer::MySQL(3pm)