如何下载此管道分隔文件?

发布于 2025-02-13 23:11:31 字数 413 浏览 0 评论 0 原文

如何下载此管道分隔文件?

在此链接中:

”您单击“下载用于全年的管道划界的制药处置地点”只需带我到一个新页面,就像我打开一个具有以下网址的PDF一样: https://apps.deadiversion.usdoj.gov/pubdisp/pub_disposal_sites.txt

我只想下载.txt文件,但是我无法弄清楚如何将其打开,因为网页!我已经尝试搜索Internet和Stackoverflow,但是我没有找到答案(我对R的新手并使用数据很新)。

有没有办法下载.txt文件?

How do I download this pipe delimited file?

It is in this link:
https://www.deadiversion.usdoj.gov/drug_disposal/takeback/

When you click on "Download For Pipe Delimited Year Round Pharmaceutical Disposal Locations" it just takes me to a new page like I'm opening a pdf with the following web address: https://apps.deadiversion.usdoj.gov/pubdisp/pub_disposal_sites.txt

I just want to download the .txt file, but I can't figure out how to as it just opens it up as a web page! I've tried searching the internet and stackoverflow, but I have found no answers (I'm pretty new to R and working with data).

Is there a way to download the .txt file?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

凯凯我们等你回来 2025-02-20 23:11:31

一种更好的方法是将其直接读取为R,例如

library(tidyverse)
df <- read_delim("https://apps.deadiversion.usdoj.gov/pubdisp/pub_disposal_sites.txt", delim = "|")
df
#> Rows: 12979 Columns: 9
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: "|"
#> chr (7): NAME, ADDL CO INFO, ADDRESS 1, ADDRESS 2, CITY, STATE, ZIP
#> dbl (2): LATITUDE, LONGITUDE
#> 
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
#> # A tibble: 12,979 × 9
#>    NAME        `ADDL CO INFO` `ADDRESS 1` `ADDRESS 2` CITY  STATE ZIP   LATITUDE
#>    <chr>       <chr>          <chr>       <chr>       <chr> <chr> <chr>    <dbl>
#>  1 WOODWARD D… DBA: CVS/PHAR… 4995 HIGHL… <NA>        WATE… MI    48328     42.7
#>  2 WOODWARD D… DBA: CVS/PHAR… 1715 COOLI… <NA>        BERK… MI    48072     42.5
#>  3 WOODWARD D… DBA: CVS/PHAR… 1625 KING … <NA>        TREN… MI    48183     42.2
#>  4 WOODWARD D… DBA: CVS/PHAR… 67181 S MA… <NA>        RICH… MI    48062     42.8
#>  5 WOODWARD D… DBA: CVS/PHAR… 31411 CHER… <NA>        WEST… MI    48186     42.3
#>  6 WOODWARD D… DBA: CVS/PHAR… 20460 MACK… <NA>        GROS… MI    48236     42.4
#>  7 WOODWARD D… DBA: CVS/PHAR… 19818 KELL… <NA>        HARP… MI    48225     42.4
#>  8 WAKEMED     <NA>           ATTN: INPA… 3000 NEW B… RALE… NC    27610     35.8
#>  9 GARFIELD B… DBA: CVS/PHAR… 318 W EL N… <NA>        ESCO… CA    92026     33.1
#> 10 WOODWARD D… DBA: CVS/PHAR… 8710 N. BE… <NA>        DEAR… MI    48127     42.4
#> # … with 12,969 more rows, and 1 more variable: LONGITUDE <dbl>

在2022-07-08创建的(v2.0.1)

A better way to do it is to read it directly into R, e.g.

library(tidyverse)
df <- read_delim("https://apps.deadiversion.usdoj.gov/pubdisp/pub_disposal_sites.txt", delim = "|")
df
#> Rows: 12979 Columns: 9
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: "|"
#> chr (7): NAME, ADDL CO INFO, ADDRESS 1, ADDRESS 2, CITY, STATE, ZIP
#> dbl (2): LATITUDE, LONGITUDE
#> 
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
#> # A tibble: 12,979 × 9
#>    NAME        `ADDL CO INFO` `ADDRESS 1` `ADDRESS 2` CITY  STATE ZIP   LATITUDE
#>    <chr>       <chr>          <chr>       <chr>       <chr> <chr> <chr>    <dbl>
#>  1 WOODWARD D… DBA: CVS/PHAR… 4995 HIGHL… <NA>        WATE… MI    48328     42.7
#>  2 WOODWARD D… DBA: CVS/PHAR… 1715 COOLI… <NA>        BERK… MI    48072     42.5
#>  3 WOODWARD D… DBA: CVS/PHAR… 1625 KING … <NA>        TREN… MI    48183     42.2
#>  4 WOODWARD D… DBA: CVS/PHAR… 67181 S MA… <NA>        RICH… MI    48062     42.8
#>  5 WOODWARD D… DBA: CVS/PHAR… 31411 CHER… <NA>        WEST… MI    48186     42.3
#>  6 WOODWARD D… DBA: CVS/PHAR… 20460 MACK… <NA>        GROS… MI    48236     42.4
#>  7 WOODWARD D… DBA: CVS/PHAR… 19818 KELL… <NA>        HARP… MI    48225     42.4
#>  8 WAKEMED     <NA>           ATTN: INPA… 3000 NEW B… RALE… NC    27610     35.8
#>  9 GARFIELD B… DBA: CVS/PHAR… 318 W EL N… <NA>        ESCO… CA    92026     33.1
#> 10 WOODWARD D… DBA: CVS/PHAR… 8710 N. BE… <NA>        DEAR… MI    48127     42.4
#> # … with 12,969 more rows, and 1 more variable: LONGITUDE <dbl>

Created on 2022-07-08 by the reprex package (v2.0.1)

如果没有你 2025-02-20 23:11:31

JK,我很愚蠢。

您可以通过以下步骤下载文件:

打开要从中提取文本的网页。
单击“右键单击”菜单。
单击“保存为”,然后在“文件名” 1Mints.txt中单击。
然后选择“另存为类型”作为“文本文档”,然后还可以。
它将在指定位置下载1mints.txt。

Jk, I am dumb.

You can Download the file by below steps:

Open the Web page from which you want to extract text.
Click the “Right Click” menu.
Click the “Save as”, then in the “Filename” 1Mints.txt comes.
Then select “Save as Type” as “Text Document” and then Okay.
It will Download 1Mints.txt at the specified location.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文