我如何将此txt文件更改为csv文件 [英] How I change this txt file into csv file

查看:120
本文介绍了我如何将此txt文件更改为csv文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此txt文件包含十六进制值我想将其更改为十进制并分为li l2 t1 t2 v1 v2 ph

这些是十六进制值

this txt file contains hex values i want to change this into dec and divided into li l2 t1 t2 v1 v2 p h
these are hex values

4f337d5000000001
4f337d5000000001
0082004600010000
0082004600010000
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100
334f464600010000
334f464600010000
4f33464601000100
4f33464601000100





< b>我尝试了什么:



建议我任何可以帮助我的方法或代码



What I have tried:

suggest me any method or code which can help me

推荐答案

例如


  • 逐行阅读文本文件

  • 将每一行转换为64-位整数并将其存储在数组中

  • 将数组中的8个值写入文本文件,用逗号分隔它们


听起来你需要学习一些基本的工作。首先,您需要阅读该文件。 输入/输出文件教程中解释了如何完成它。



之后你必须将字符串分成几部分,如 stackoverflow的答案。我最喜欢上一个示例代码。



比使用stroul函数将十六进制字符串解析成一个数字而你是在最后的输出步骤,应该是一块蛋糕。
Sounds like you need to learn some basics for your job. At first you need to read the file. How it can be done is explained in Input/output with files tutorial.

After that you must split the string in parts as discussed in this answer of stackoverflow. I like the last sample code most.

Than use the stroul function to parse the hex-string into a number and you are on the final output step, which should be a piece of cake.


这篇关于我如何将此txt文件更改为csv文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆