Linux Intro - Remove 302 字符
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 字符的更多相关文章
- linux驱动初探之字符驱动
关键字:字符驱动.动态生成设备节点.helloworld linux驱动编程,个人觉得第一件事就是配置好平台文件,这里以字符设备,也就是传说中的helloworld为例~ 此驱动程序基于linux3. ...
- Linux 下查看文件字符编码和转换编码
Linux 下查看文件字符编码和转换编码 如果你需要在Linux中操作windows下的文件,那么你可能会经常遇到文件编码转换的问题.Windows中默认的文件格式是GBK(gb2312),而Linu ...
- 【转】深入浅出:Linux设备驱动之字符设备驱动
深入浅出:Linux设备驱动之字符设备驱动 一.linux系统将设备分为3类:字符设备.块设备.网络设备.使用驱动程序: 字符设备:是指只能一个字节一个字节读写的设备,不能随机读取设备内存中的某一数据 ...
- Linux块设备和字符设备
块设备:系统能够随机无序访问固定大小的数据片的设备,这些数据片称为块.块设备是以固定大小长度来传送资料的,它使用缓冲区暂存数据,时机成熟后从缓存中一次性写入到设备或者从设备中一次性放到缓存区.常见的块 ...
- linux中c表示字符设备文件符号
linux中c表示字符设备文件,b表示块设备文件,l表示符号链接文件,r表示可读权限,w表示可写权限.linux文件属性解读:文件类型:-:普通文件 (f)d:目录文件b:块设备文件 (block)c ...
- 【转】DOS与linux的断行字符
转自:http://www.2cto.com/os/201109/104833.html 今天配置linux的dns服务器,在配置的时候,在linux下修改配置文件感觉很麻烦,于是想到把配置文件拿到w ...
- Linux下vi替换字符命令操作实例
在Linux下的开发中,经常涉及到对文件里的字符进行处理,当中,对字符的替换操作也是非常的频繁. 本文以一个实际的文件为例,具体介绍了Linux下经常使用的vi替换字符命令,为相关的开发工作提供给了參 ...
- Linux驱动开发2——字符设备驱动
1.申请设备号 #include <linux/fs.h> int register_chrdev_region(dev_t first, unsigned int count, char ...
- Linux应用程序访问字符设备驱动详细过程【转】
本文转载自:http://blog.csdn.net/coding__madman/article/details/51346532 下面先通过一个编写好的内核驱动模块来体验以下字符设备驱动 可以暂时 ...
随机推荐
- Java基本类型学习
基本类型,或者叫做内置类型,是JAVA中不同于类的特殊类型.它们是我们编程中使用最频繁的类型.java是一种强类型语言,第一次申明变量必须说明数据类型,第一次变量赋值称为变量的初始化. 1. Java ...
- up7.1-asp.net-本地测试教程
1.1. ASP.NET 框架:.NET Framework 4.5 依赖库:csredis,Newtonsoft.Json 安装redis 下载 redis-x64:http://pan.bai ...
- sql语言的一大类 DML 数据的操纵语言
-DML(insert,update,delete) 1.插入数据insert into 表名(列,列...)values(值,值...)//当插入的数据与表格一一对应时,列可以省略insert in ...
- DLL的概念、dll导出类(转贴)
1. DLL的概念DLL(Dynamic Linkable Library),动态链接库,可以向程序提供一些函数.变量或类.这些可以直接拿来使用.静态链接库与动态链接库的区别:(1)静态链接库与动态链 ...
- Arduino Nano 读取ADS1100实例
利用Arduino Nano的wire库可以很方便对ADS1100进行设置和读取转换后的数据. /* * Arduino reads ADS1100 I2C 16bit diff ADC */ /* ...
- GetFileVersionInfoSize函数确定操作系统是否可以检索指定文件的版本信息
GetFileVersionInfoSize函数 -------------------------------------------------- ------------------------ ...
- [LeetCode 题解]: Valid Parentheses
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the inpu ...
- requirejs 配制
baseUrl: 用来配制动态加载脚本时,脚本文件的起始位置,此属性可以指定值,也可以由 requirejs 自动计算出值: 1:不进行任何配制: 假如 a.html 中引用 require.js 文 ...
- nginx uwsgi flask相关配置
一.安装Nginx 在 /home/download下下载压缩包 wget https://nginx.org/download/nginx-1.12.2.tar.gz 解压缩 tar zxvf ng ...
- Django Manage File
default_storage >>> from django.core.files.base import ContentFile >>> from django ...