Tag Info

New answers tagged

0

The new edited script it's ok but stops on a new line here is the error root@localhost:~/python# ./compare.py input1.txt input2.txt output.txt Traceback (most recent call last): File "./compare.py", line 46, in <module> for row in csvReader: File "/usr/lib/python3.2/codecs.py", line 300, in decode (result, consumed) = ...


0

You could use sqlite for joining your data: $ sqlite3 <<EOT .mode csv CREATE TABLE file1 (A11,A12,A13,A14,A15,A16,A17,A18,A19,A110,A111); CREATE TABLE file2 (B11,B12,B13,B14); .import file1 file1 .import file2 file2 SELECT DISTINCT file1.*, ifnull(file2.B14,"NOACT") FROM file1 LEFT JOIN file2 ON abs(julianday(file1.A11) - julianday(file2.B11))*86400.0 ...


0

The following script should do what you are looking for in python: #!/usr/bin/env python3 import sys import csv import bisect import re timeRange = 1 # seconds # Timestamps should match the following regex timestampRegex = re.compile('[0-9]*:*[0-9]*:[0-9][0-9]\.*[0-9]*') # Convert the time from a string 'hh:mm:ss' to a float def timeToFloat(time): # ...



Top 50 recent answers are included