diff --git a/src/util.py b/src/util.py index 67f32ee..aeacaed 100644 --- a/src/util.py +++ b/src/util.py @@ -60,4 +60,10 @@ def split_file_by_date(raw_file_path, begin, end): split_file.write(line) raw_file.close() - split_file.close() \ No newline at end of file + split_file.close() + + +def parse_line(line): + user_id, item_id, behavior_type, user_geohash, item_category, time, date = line.split(delimiter) + date = datetime.datetime.strptime(date, "%Y-%m-%d %H") + return user_id, item_id, behavior_type, user_geohash, item_category, time, date \ No newline at end of file