Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ST|ZIPCODE|GEO_ID|GEO_TTL|FOOTID_GEO|NAICS2012|NAICS2012_TTL|FOOTID_NAICS|YEAR|EMPSZES|EMPSZES_TTL|ESTAB|ESTAB_F
- 01|35004|8610000US35004|35004(MOODY,AL)||00|Total for all sectors||2012|001|All establishments|167|
- 01|35004|8610000US35004|35004(MOODY,AL)||00|Total for all sectors||2012|212|Establishments with 1 to 4 employees|91|
- colclasses = sapply(read.table(edited_data, nrows=1, sep="|", header=T),class)
- your_data <- fread(edited_data, sep="|", sep2=NULL, nrows=-1L, header=T, na.strings="NA",
- stringsAsFactors=FALSE, verbose=FALSE, autostart=30L, skip=-1L, select=NULL,
- colClasses=colclasses)
- original_file = file_path_to_original_file # e.g. "/Users/User/file.dat"
- edited_file = file_path_to_new_file # e.g. "/Users/User/file_edited.dat"
- with open(original_file) as inp:
- with open(edited_file, "w") as op:
- for line in inp:
- op.write(line.replace("<br/>", "")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement