11-19-2009
Thanks ppl.
Went for the simple approach in the end and used Cabraos method of just creating new files without the offending fields.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I want to compare two files. All records in file 2 that are not in file 1 should be output to file 3.
For example:
file 1
123
1234
123456
file 2
123
2345
23456
file 3 should have
2345
23456
I have looked at diff, bdiff, cmp, comm, diff3 without any luck! (2 Replies)
Discussion started by: blt123
2 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I want to perform diff on 2 files & print the lines which first field is different.
e.g.
file 1:
12,23,ask
23,12,bcd
file2:
12,14,bac
24,13,ecf
I want the output as:
23,12,bcd
means: lines from file 1 which are not there in file 2 & not having the same starting field.
... (1 Reply)
Discussion started by: harish.madu
1 Replies
3. Shell Programming and Scripting
Hi,
svn diff does not work very well with 2 local folders, so I am trying to do this diff using diff locally.
since there's a bunch of meta files in an svn directory, I want to do a diff that excludes everything EXCEPT *.java files. there seems to be only an --exclude option, so I'm not sure... (3 Replies)
Discussion started by: ackbarr
3 Replies
4. Shell Programming and Scripting
Diff output as follows:
< AAA BBB CCC DDD EEE 123
> PPP QQQ RRR SSS TTT 111
> VVV WWW XXX YYY ZZZ 333
> AAA BBB CCC DDD EEE 124
How can i use awk to compare the last field to determine if the counter has increased, and need to ensure that the first 4 fields must have the same... (15 Replies)
Discussion started by: ux4me
15 Replies
5. Shell Programming and Scripting
Moderator, please, delete this topic (1 Reply)
Discussion started by: optik77
1 Replies
6. Shell Programming and Scripting
Hi guys
I have two file which I sdiff.
ie
file 1: AA,12,34,56,,789,101,,6666
file 2: AA,12,34,56,,789,101,,7777
The last comma separated value will always change from one day to the next.
Is there another unix utility I can use that will sdiff two files but ignore the last comma... (1 Reply)
Discussion started by: wny201
1 Replies
7. UNIX for Dummies Questions & Answers
Hi everyone, I have 2 very large files (each file have about 600k lines) and I want to see which numbers in file1 are not in file2, I thought of doing a diff, however diff will also display the changes, instead of just adds and delete, this makes it very hard to sort out just the adds and deletes.... (1 Reply)
Discussion started by: robertrobert905
1 Replies
8. Shell Programming and Scripting
Hi,
I am new to shell scripting.
please help me to find out the solution.
I need a script where we need to read the text file(consists of all file names) and get the file names one by one
and append the date suffix for each file name as 'yyyymmdd' .
Then search each file if exists... (1 Reply)
Discussion started by: Lucky123
1 Replies
9. Shell Programming and Scripting
Attached is a file called diff.txt
It is the output from this command:
diff -y --suppress-common-lines --width=5000 1.txt 2.txt > diff.txt
I have also attached 1.txt and 2.txt for your convenience.
Both 1.txt and 2.txt contain one very long CSV string.
File 1.txt is a CSV dump of... (0 Replies)
Discussion started by: gvolpini
0 Replies
10. Shell Programming and Scripting
Guys i have 3 files,
but i want to compare and diff only the 2nd column
path=`/home/whois/doms`
for i in `cat domain.tx`
do
whois $i| sed -n '/Registry Registrant ID:/,/Registrant Email:/p' > $path/$i.registrant
whois $i| sed -n '/Registry Admin ID:/,/Admin Email:/p' > $path/$i.admin... (10 Replies)
Discussion started by: kenshinhimura
10 Replies
LEARN ABOUT DEBIAN
sql::translator::diff
SQL::Translator::Diff(3pm) User Contributed Perl Documentation SQL::Translator::Diff(3pm)
NAME
SQL::Translator::Diff - determine differences between two schemas
DESCRIPTION
Takes two input SQL::Translator::Schemas (or SQL files) and produces ALTER statments to make them the same
SNYOPSIS
Simplest usage:
use SQL::Translator::Diff;
my $sql = SQL::Translator::Diff::schema_diff($source_schema, 'MySQL', $target_schema, 'MySQL', $options_hash)
OO usage:
use SQL::Translator::Diff;
my $diff = SQL::Translator::Diff->new({
output_db => 'MySQL',
source_schema => $source_schema,
target_schema => $target_schema,
%$options_hash,
})->compute_differences->produce_diff_sql;
OPTIONS
ignore_index_names
Match indexes based on types and fields, ignoring name.
ignore_constraint_names
Match constrains based on types, fields and tables, ignoring name.
output_db
Which producer to use to produce the output.
case_insensitive
Ignore case of table, field, index and constraint names when comparing
no_batch_alters
Produce each alter as a distinct "ALTER TABLE" statement even if the producer supports the ability to do all alters for a table as one
statement.
ignore_missing_methods
If the diff would need a method that is missing from the producer, just emit a comment showing the method is missing, rather than
dieing with an error
PRODUCER FUNCTIONS
The following producer functions should be implemented for completeness. If any of them are needed for a given diff, but not found, an
error will be thrown.
o "alter_create_constraint($con)"
o "alter_drop_constraint($con)"
o "alter_create_index($idx)"
o "alter_drop_index($idx)"
o "add_field($fld)"
o "alter_field($old_fld, $new_fld)"
o "rename_field($old_fld, $new_fld)"
o "drop_field($fld)"
o "alter_table($table)"
o "drop_table($table)"
o "rename_table($old_table, $new_table)" (optional)
o "batch_alter_table($table, $hash)" (optional)
If the producer supports "batch_alter_table", it will be called with the table to alter and a hash, the keys of which will be the
method names listed above; values will be arrays of fields or constraints to operate on. In the case of the field functions that take
two arguments this will appear as a hash.
I.e. the hash might look something like the following:
{
alter_create_constraint => [ $constraint1, $constraint2 ],
add_field => [ $field ],
alter_field => [ [$old_field, $new_field] ]
}
o "preprocess_schema($class, $schema)" (optional)
"preprocess_schema" is called by the Diff code to allow the producer to normalize any data it needs to first. For example, the MySQL
producer uses this method to ensure that FK contraint names are unique.
Basicaly any changes that need to be made to produce the SQL file for the schema should be done here, so that a diff between a parsed
SQL file and (say) a parsed DBIx::Class::Schema object will be sane.
(As an aside, DBIx::Class, for instance, uses the presence of a "preprocess_schema" function on the producer to know that it can diff
between the previous SQL file and its own internal representation. Without this method on th producer it will diff the two SQL files
which is slower, but known to work better on old-style producers.)
AUTHOR
Original Author(s) unknown.
Refactor/re-write and more comprehensive tests by Ash Berlin "ash@cpan.org".
Redevelopment sponsored by Takkle Inc.
perl v5.14.2 2012-05-01 SQL::Translator::Diff(3pm)