[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH] CSV import w/ CR/LF pairs




Hi,

This is a quick-'n-dirty patch for the csv-import module (libcsv) in order
to correctly import files containing CR/LF pairs (like in DOS, or like
what my online banking provides ;-] ). This is based on the debian
(potato) sources for 0.45; I apologize if this has already been posted.

HTH,
Stéphane


diff -u -r gnumeric-0.45/plugins/ff-csv/csv-io.c gnumeric-0.45-stephane/plugins/ff-csv/csv-io.c
--- gnumeric-0.45/plugins/ff-csv/csv-io.c	Fri Dec  3 21:22:31 1999
+++ gnumeric-0.45-stephane/plugins/ff-csv/csv-io.c	Sun Dec 26 12:42:50 1999
@@ -108,6 +108,9 @@
 			} else
 				return FALSE;
 		}
+		/* Skip CR in CR/LF pairs */
+		if ( src->cur[0] == '\r' && src->cur[1] == '\n' )
+		  ++(src->cur);
 	}
 	return TRUE;
 }


-- 
I use Unix because reboots are for hardware upgrades.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]