一系列sed命令可在命令行上运行,但不能在脚本中运行
我正在使用此SE数据查询的.csv输出,它看起来像这样(仅包含5022个条目): "{ ""id"": 281952, ""title"": ""Flash 11.2 No Longer Supported by Google Play"" }" "{ ""id"": 281993, ""title"": ""Netbeans won't open in Ubuntu"" }" (它的行^M尾在[number]和““ title”“之间)。我需要它看起来像这样: 281952,Flash 11.2 No Longer Supported by Google Play 281993,Netbeans won't open in Ubuntu 我在某个文本编辑器中修复了该问题,该编辑器将很容易保持匿名,但是我想创建一个脚本,这样我就不必在每次刷新查询时都再次执行此操作,因此其他人可以使用它。我用过sed... 这一系列命令可以完美地工作(尽管效率可能很低;这只是一个反复试验的解决方案): # Print the ^M and remove them, write to …