chiark / gitweb /
crappy program from the web
authorian <ian>
Wed, 24 Mar 2004 23:54:32 +0000 (23:54 +0000)
committerian <ian>
Wed, 24 Mar 2004 23:54:32 +0000 (23:54 +0000)
spice2data.cpp [new file with mode: 0644]

diff --git a/spice2data.cpp b/spice2data.cpp
new file mode 100644 (file)
index 0000000..9c4ff7b
--- /dev/null
@@ -0,0 +1,33 @@
+/*  This is a small tool to remove 'garbage' from a spice output file
+ *  so this file can be used with gnuplot.
+ *
+ *               Written by Bart Blanckaert 
+ *                     februari 2000
+ *
+ *  compile with: g++ spice2data.cpp -o spice2data
+ *  copy executable to /usr/local/bin (for example)
+ *  use like this: spice < inputfile | spice2data > outputfile
+ */
+
+
+#include <iostream.h>
+#include <stdio.h>
+#include <string.h>
+int main()
+{
+       char lijn[256];
+
+       while (cin.getline(lijn,sizeof(lijn))!=0) { 
+               if (strncmp(lijn,"x",1)==0)  
+               break;
+       }
+       cin.getline(lijn,sizeof(lijn));
+       while (cin.getline(lijn,sizeof(lijn))!=0) {
+               if (strncmp(lijn,"y",1)==0)
+               break;
+               cout << lijn << endl ;
+       }
+       while (cin.getline(lijn,sizeof(lijn))!=0);
+return 0;
+
+}