I have a file originally provided from a SQL database on a Windows platform.

I transfer the file via ftp in binary format, remove the ^M's from the end of all lines.

I have attempted to use tr ( cat infile | tr -d '\240' ) and sed (cat infile | sed 's/\240//g' ) to remove the occurences of \240 in the file with no luck.

I have no problem removing this octal character in vi.

If i run the Windows command, 'type infile', \240 shows up as an a with a grave over it.

In notepad, it shows up as a space.

I need to incorporate into a script a method of deleting these octal characters because other unix commands fail w/ the following error:

can't read STDIN: Illegal byte sequence

Any ideas would be greatly appreciated.

Thx in advance,

pat

cat test.cpp | tr '\240' ' '>111.txt

cat 111.txt | tr -d '\302'>555.txt

Linux Intro - Remove 302 字符的更多相关文章

  1. linux驱动初探之字符驱动

    关键字:字符驱动.动态生成设备节点.helloworld linux驱动编程,个人觉得第一件事就是配置好平台文件,这里以字符设备,也就是传说中的helloworld为例~ 此驱动程序基于linux3. ...

  2. Linux 下查看文件字符编码和转换编码

    Linux 下查看文件字符编码和转换编码 如果你需要在Linux中操作windows下的文件,那么你可能会经常遇到文件编码转换的问题.Windows中默认的文件格式是GBK(gb2312),而Linu ...

  3. 【转】深入浅出:Linux设备驱动之字符设备驱动

    深入浅出:Linux设备驱动之字符设备驱动 一.linux系统将设备分为3类:字符设备.块设备.网络设备.使用驱动程序: 字符设备:是指只能一个字节一个字节读写的设备,不能随机读取设备内存中的某一数据 ...

  4. Linux块设备和字符设备

    块设备:系统能够随机无序访问固定大小的数据片的设备,这些数据片称为块.块设备是以固定大小长度来传送资料的,它使用缓冲区暂存数据,时机成熟后从缓存中一次性写入到设备或者从设备中一次性放到缓存区.常见的块 ...

  5. linux中c表示字符设备文件符号

    linux中c表示字符设备文件,b表示块设备文件,l表示符号链接文件,r表示可读权限,w表示可写权限.linux文件属性解读:文件类型:-:普通文件 (f)d:目录文件b:块设备文件 (block)c ...

  6. 【转】DOS与linux的断行字符

    转自:http://www.2cto.com/os/201109/104833.html 今天配置linux的dns服务器,在配置的时候,在linux下修改配置文件感觉很麻烦,于是想到把配置文件拿到w ...

  7. Linux下vi替换字符命令操作实例

    在Linux下的开发中,经常涉及到对文件里的字符进行处理,当中,对字符的替换操作也是非常的频繁. 本文以一个实际的文件为例,具体介绍了Linux下经常使用的vi替换字符命令,为相关的开发工作提供给了參 ...

  8. Linux驱动开发2——字符设备驱动

    1.申请设备号 #include <linux/fs.h> int register_chrdev_region(dev_t first, unsigned int count, char ...

  9. Linux应用程序访问字符设备驱动详细过程【转】

    本文转载自:http://blog.csdn.net/coding__madman/article/details/51346532 下面先通过一个编写好的内核驱动模块来体验以下字符设备驱动 可以暂时 ...

随机推荐

  1. iPhone Development – core data relationships tutorial part 1

    I’m going to start a short series on Core Data relationships and maybe throw in some general Core Da ...

  2. 【转】java中定义二维数组的几种写法

    原文链接 注:以下的 type[][] var 也可以这样申明 type var[][] type为数组的类型,var为变量名 写法一:行列固定的数组 //定义二维数组写法1 class Test { ...

  3. Android dex分包方案和热补丁原理

    一.分包的原因: 当一个app的功能越来越复杂,代码量越来越多,也许有一天便会突然遇到下列现象: 1. 生成的apk在2.3以前的机器无法安装,提示INSTALL_FAILED_DEXOPT 2. 方 ...

  4. hibernate:对于java.lang.NoSuchMethodError: antlr.collections.AST.getLine()I错误解决办法

    在J2EE框架下开发web网站,这种问题经常遇到,只要我们网上搜一下,就可以看到很多版本的,我整理一下:  第一种可能性解决:看看我的项目:主要 是里面的Structs 1.3 (structs 2) ...

  5. linux命令の ./configure --prefix

    源码的安装一般由3个步骤组成:配置(configure).编译(make).安装(make install). Configure是一个可执行脚本,它有很多选项,在待安装的源码路径下使用命令./con ...

  6. MongoDB默认配置

    mongodb使用了yaml格式定义的配置文件(http://www.yaml.org/) 默认为: # mongod.conf #where to log logpath=/var/log/mong ...

  7. tensorflow使用

    近期在工作中使用tensorflow训练神经网络模型,使用方法简要记录. 环境配置

  8. TDE--相关Demo

    SQL Server 2008引入透明数据加密(Transparent Data Encryption),它允许你完全无需修改应用程序代码而对整个数据库加密.当一个用户数据库可用且已启用TDE时,在写 ...

  9. [C#]合并单元格(行、列)

    详细链接:https://shop499704308.taobao.com/?spm=a1z38n.10677092.card.11.594c1debsAGeak説明:控件ID指的是页面上面的Grid ...

  10. django shortcut function

    render() render(request, template_name, context=None, content_type=None, status=None, using=None) 必须 ...