在特定行中存在特定值的ruby中从CSV文件中删除行的巧妙方法是什么?
这是一个文件的例子:
350 lbs., Outrigger Footprint, 61" x 53", Weight, 767 lbs., 300-2080
350 lbs., Outrigger Footprint, 61" x 53", Weight, 817 lbs., 300-2580
350 lbs., Outrigger Footprint, 61" x 53", Weight, 817 lbs., 300-2580
350 lbs., Outrigger Footprint, 69" x 61", Weight, 867 lbs., 300-3080
350 lbs., Outrigger Footprint, 69" x 61", Weight, 867 lbs., 300-3080
Run Code Online (Sandbox Code Playgroud)
理想情况下,我想要一个只用这个创建的新文件:
350 lbs., Outrigger Footprint, 61" x 53", Weight, 767 lbs., 300-2080
350 lbs., Outrigger Footprint, 61" x 53", Weight, 817 lbs., 300-2580 …Run Code Online (Sandbox Code Playgroud) 我正在尝试通过RVM安装ruby并且收到以下错误并且日志不是很清楚发生了什么,有没有人碰到这个?我似乎记得Ruby不应该以root身份安装,但我对我所获得的权限错误有点怀疑.
**Installing Ruby from source to: /Users/mark/.rvm/rubies/ruby-1.9.2-p290, this may take a while depending on your cpu(s)...
ruby-1.9.2-p290 - #fetching
ruby-1.9.2-p290 - #downloading ruby-1.9.2-p290, this may take a while depending on your connection...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0Warning: Failed to create the file ruby-1.9.2-p290.tar.bz2: Permission denied
0 8604k 0 16150 0 0 14980 0 0:09:48 0:00:01 …Run Code Online (Sandbox Code Playgroud)