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. PrintWriter类

    PrintWriter是一种过滤流,也是一种处理流,即能对字节流和字符流进行处理. 1.查询API后,我们发现,会有八种构造方法.即: PrintWriter(File file) Creates a ...

  2. ettercap dns_spoof

    首先编辑网页,打开apache2服务器,编辑好etter.dns 然后开始ettercap -G 的操作 sniff选择好自己使用的网卡 scan hosts ,扫描完将目标和网关添加到目标一目标二 ...

  3. RollingFileAppender

    http://logback.qos.ch/manual/appenders.html#RollingFileAppender 1.基于时间的滚动策略 TimeBasedRollingPolicy 就 ...

  4. JavaScript语言精粹 笔记04 数组

    数组1 数组字面量2 长度3 删除4 列举5 混淆的地方6 方法7 维度 数组1 数组字面量 var empty = []; var numbers = [ 'zero', 'one', 'two', ...

  5. CodeForces 519E A and B and Lecture Rooms(倍增)

    A and B are preparing themselves for programming contests. The University where A and B study is a s ...

  6. eclipse开发hadoop2.2.0程序

    在 Eclipse 环境下可以方便地进行 Hadoop 并行程序的开发和调试.前提是安装hadoop-eclipse-plugin,利用这个 plugin, 可以在 Eclipse 中创建一个 Had ...

  7. 使用SqlBulkCopy进行批量插入数据时踩过的坑

    之前一直都没用过SqlBulkCopy关键字进行数据插入,更没了解过. 事因:因业务需要在数据表中添加两列,然后将数据插入进表中 之前都是这样写的 dt.Columns.Add(new DataCol ...

  8. windbg符号路径设置

    .sympath C:\Users\leoyin\Desktop\last;SRV*C:\Symbols*http://msdl.microsoft.com/download/symbols  

  9. 深入了解java虚拟机(JVM) 第一章 内存区域分布情况

    前言: 本文主要是我自己总结的一些技巧,可能对搜到这篇的来观看的朋友有些很难理解,请见谅. 一.JVM的运行时数据区 总共有两个区域: 1.线程共享区:方法区,java堆 2.线程独占区:虚拟机栈,本 ...

  10. 读优&&输优

    很nb的技巧……但奇怪的是只能对文件使用…… 然而交到OJ上或者比赛的时候都没有关系→_→ 我大概也只能弄弄这些花里胡哨的东西了→_→ 原理不清楚,背个板子好了 //minamoto #include ...