* Encoding: UTF-8. *Import .sav file - make sure to replace file path to your specific one inside single quotes. GET FILE='C:\path\to\file.sav'. DATASET NAME DataSet1 WINDOW=FRONT. *Import .xls file. GET DATA /TYPE=XLSX /FILE='C:\path\to\file.xlsx' /SHEET=name 'Name-of-Sheet' . EXECUTE. DATASET NAME DataSetExcel WINDOW=FRONT. *Import .txt file. *If your file is more than 8000 characters in length you must include the LRECL section *You must list all the column names and the character length of each variable - The A in parentheses defines it as a string variable. NEW FILE. DATASET NAME NewDataName WINDOW=FRONT. FILE HANDLE yourtempname /NAME = "C:\path\to\file.xlsx" /LRECL=9300. DATA LIST FILE=yourtempname/ VariableA 1-12 VariableB 13-35 (A) VariableC 36-38 VariableD 39-46 VariableE 47-96 (A). LIST. *******DOWNLOAD THE .CSV FILE AND THEN COPY THE PATH FILE AND REPLACE IT IN THE NEXT SECTION IN THE QUOTATION MARKS****** ******YOU CAN SELECT ALL THE SYNTAX BELOW AND SELECT RUN - WOO** *Import csv file. GET DATA /TYPE=TXT /FILE="C:\Users\Desktop\Most Used Syntax\netflix_titles.csv" /ENCODING='UTF8' /DELIMITERS="," /QUALIFIER='"' /ARRANGEMENT=DELIMITED /FIRSTCASE=2 /DATATYPEMIN PERCENTAGE=95.0 /VARIABLES= show_id AUTO type AUTO title AUTO director AUTO cast AUTO country AUTO date_added AUTO release_year AUTO rating AUTO duration AUTO duration_type AUTO listed_in AUTO description AUTO /MAP. RESTORE. CACHE. EXECUTE. DATASET NAME DatasetName. *Add descriptive labels to your variable names. VARIABLE LABELS type "Movie or TV Show" title "Title" director "Director" cast "Cast" country "Country of Title" date_added "Date Added" release_year "Year of Release" rating "Title Rating" duration "Duration" duration_type "Duration - Minutes or Seasons" listed_in "Listed In" description "Descritpion of Title". *Add values and labels to variable content. ADD VALUE LABELS type 1 "Movie" 2 "TV Show". *If variables need the same value labels, you can include multiple variables in a list like so ADD VALUE LABELS Q405_1 Q405_2 Q405_3 Q405_4 Q405_5 Q405_6 1 "Yes" 0 "No". *This defines what values are classified as missing. MISSING VALUES type (3). *Change variable measures from nominal, scale, and ordinal. VARIABLE LEVEL show_id (NOMINAL). VARIABLE LEVEL release_year duration (SCALE). *Create a new variable. COMPUTE age_title = 2020-release_year. FREQ var = age_title. *Recode, roll up, or put data into different buckets within the same variable. RECODE age_title (0,1=1) (2 THRU 5 =2) (6 THRU 20 =3) (ELSE = 4). *Recode, roll up, or put data into different buckets into a different variable. RECODE release_year (2020, 2019=1) (2015 THRU 2018 5=2) (2000 THRU 2014 =3) (LOWEST THRU 1999 = 4) INTO age_title_v2. ADD VALUE LABELS age_title age_title_v2 1 "Pretty Darn New" 2 "Feels Recent" 3 "This Millenium" 4 "A While Ago". *Output descriptive frequencies. FREQUENCIES variables= age_title age_title_v2. *quick and easy way to output frequency tables for ALL variables. freq var = all. *Save your data as an SPSS file. SAVE OUTFILE='C:\Users\file\path.sav' /COMPRESSED.