[interchange-cvs] interchange - kwalsh modified code/UI_Tag/import_fields.coretag

interchange-core@icdevgroup.org interchange-core@icdevgroup.org
Thu Oct 31 12:55:01 2002


User:      kwalsh
Date:      2002-10-31 17:54:11 GMT
Modified:  code/UI_Tag import_fields.coretag
Log:
	* Changed the import to strip a CR as well as a LF from the
	  end of each input line, to help people who import using files
	  generated using MS software.  Changes suggested by Jonathan
	  Clark.

Revision  Changes    Path
1.4       +3 -4      interchange/code/UI_Tag/import_fields.coretag


rev 1.4, prev_rev 1.3
Index: import_fields.coretag
===================================================================
RCS file: /var/cvs/interchange/code/UI_Tag/import_fields.coretag,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- import_fields.coretag	6 Aug 2002 18:52:33 -0000	1.3
+++ import_fields.coretag	31 Oct 2002 17:54:11 -0000	1.4
@@ -1,4 +1,3 @@
-
 UserTag import_fields Order table
 UserTag import_fields addAttr
 UserTag import_fields Routine <<EOR
@@ -178,13 +177,13 @@
   TABLE: {
 	if(! $table) {
 		$table = <UPDATE>;
-		chomp $table;
+		$table =~ s/\r?\n$//;
 		$change_sub->($table);
 	}
 #::logDebug("db now=$db");
 	if(! $opt->{fields}) {
 		$fields = <UPDATE>;
-		chomp $fields;
+		$fields =~ s/\r?\n$//;
 		$fields =~ s/$delimiter/ /g;
 		$out .= "${tmsg}Using fields from file: '$fields'\n";
 	}
@@ -212,7 +211,7 @@
 	my $delcount = 0;
 	my $addcount = 0;
 	while(<UPDATE>) {
-		chomp;
+		s/\r?\n$//;
 		$totcount++;
 		($k, @f) = split /$delimiter/o, $_;
 		if(/^\f(\w+)$/) {