11_12_2018

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
11_12_2018 [2018/11/14 21:48] cynthia.kahn11_12_2018 [2018/11/14 22:01] (current) cynthia.kahn
Line 9: Line 9:
 **//Some useful commands for handling tweets dataset//** **//Some useful commands for handling tweets dataset//**
  
-sed -i 's/\\//g' filename +sed -i 's/\\//g' filename \\ 
-string = string.replace("\n","").replace("\r",""+string = string.replace("\n","").replace("\r",""\\ 
 +\\ 
 **//SQL to create table tweets_info//** **//SQL to create table tweets_info//**
-DROP TABLE IF EXISTS tweets_info; +\\  
- +DROP TABLE IF EXISTS tweets_info; \\ 
-CREATE TABLE tweets_info( +\\  
- tweetCreated VARCHAR(50),  +CREATE TABLE tweets_info( \\ 
-        tweetID BIGINT,  + tweetCreated VARCHAR(50), \\  
-        tweetText TEXT, +        tweetID BIGINT, \\ 
-        display_text_range VARCHAR(50) NULL, +        tweetText TEXT, \\ 
-        source TEXT, +        display_text_range VARCHAR(50) NULL, \\ 
-        truncated VARCHAR(10), +        source TEXT,  \\ 
-        in_reply_to_status_id VARCHAR(50), +        truncated VARCHAR(10), \\ 
-        in_reply_to_user_id VARCHAR(50), +        in_reply_to_status_id VARCHAR(50), \\ 
-        in_reply_to_screen_name TEXT, +        in_reply_to_user_id VARCHAR(50), \\ 
-        tweetUser BIGINT,  +        in_reply_to_screen_name TEXT, \\ 
-        tweetGeoType TEXT, +        tweetUser BIGINT, \\ 
-        tweetGeoCoord TEXT, +        tweetGeoType TEXT, \\ 
-        tweetCoordType TEXT, +        tweetGeoCoord TEXT, \\ 
-        tweetCoord TEXT, +        tweetCoordType TEXT, \\ 
-        placeID TEXT, +        tweetCoord TEXT, \\ 
-        placeURL TEXT, +        placeID TEXT, \\ 
-        placeType TEXT, +        placeURL TEXT, \\ 
-        placeCountry TEXT, +        placeType TEXT, \\ 
-        tweetPFullName TEXT,  +        placeCountry TEXT, \\ 
-        tweetPCountryCode TEXT,  +        tweetPFullName TEXT, \\ 
-        tweetPname TEXT,  +        tweetPCountryCode TEXT, \\  
-        tweetPBBox1x VARCHAR(50),  +        tweetPname TEXT,  \\ 
-        tweetPBBox1y VARCHAR(50),  +        tweetPBBox1x VARCHAR(50), \\  
-        tweetPBBox2x VARCHAR(50),   +        tweetPBBox1y VARCHAR(50), \\ 
-        tweetPBBox2y VARCHAR(50),   +        tweetPBBox2x VARCHAR(50),  \\ 
-        tweetPBBox3x VARCHAR(50),   +        tweetPBBox2y VARCHAR(50),  \\ 
-        tweetPBBox3y VARCHAR(50),   +        tweetPBBox3x VARCHAR(50),  \\ 
-        tweetPBBox4x VARCHAR(50),   +        tweetPBBox3y VARCHAR(50),  \\ 
-        tweetPBBox4y VARCHAR(50),  +        tweetPBBox4x VARCHAR(50),  \\ 
-        placeAttributes TEXT, +        tweetPBBox4y VARCHAR(50), \\ 
-        tweetContributors TEXT NULL, +        placeAttributes TEXT,  \\ 
-        is_quote_status VARCHAR(50), +        tweetContributors TEXT NULL, \\ 
-        retweetCount INTEGER, +        is_quote_status VARCHAR(50),  \\ 
-        favoriteCount INTEGER, +        retweetCount INTEGER,  \\ 
-        entitiesID BIGINT, +        favoriteCount INTEGER,  \\ 
-        entitiesMediaID BIGINT, +        entitiesID BIGINT,  \\ 
-        extendedEntitiesID BIGINT, +        entitiesMediaID BIGINT,   \\ 
-        favorited VARCHAR(10), +        extendedEntitiesID BIGINT,  \\ 
-        retweeted VARCHAR(10), +        favorited VARCHAR(10),  \\ 
-        possibly_sensitive VARCHAR(50), +        retweeted VARCHAR(10),   \\ 
-        filter_level TEXT, +        possibly_sensitive VARCHAR(50),   \\ 
-        tweetLang TEXT, +        filter_level TEXT,    \\ 
-        tweetTimestamp BIGINT, +        tweetLang TEXT,    \\ 
-        matchingRulesTag TEXT NULL, +        tweetTimestamp BIGINT,   \\ 
-        matchingRulesID BIGINT +        matchingRulesTag TEXT NULL,   \\ 
-);+        matchingRulesID BIGINT   \\ 
 +);  \\ 
 +\\  
 +psql cynthiak   \\ 
 +\copy tweets_info FROM '/home/cynthiak/tab_to_semi.txt' WITH DELIMITER ';'  \\
  
  
  • 11_12_2018.txt
  • Last modified: 2018/11/14 22:01
  • by cynthia.kahn