英文:
Notepad++ - swap endianess of values in text file
问题
0XC71F2A11 0X46776208 0X448659B3 0X00000000 0X00000000 0XBFC3BAD1
0XC7122457 0X4680A201 0X448659B3 0X00000000 0X00000000 0XBFC3BAD1
0XC7147823 0X46756BD2 0X448659B3 0X00000000 0X00000000 0X3FCE418B
0XC7144C13 0X46814776 0X448659B3 0X00000000 0X00000000 0X3FCE418B
我需要交换每个值的字节顺序,例如 0XC71F2A11
-> 0X112A1FC7
英文:
I have text file filled with hex values, six at each line, like this:
0XC71F2A11 0X46776208 0X448659B3 0X00000000 0X00000000 0XBFC3BAD1
0XC7122457 0X4680A201 0X448659B3 0X00000000 0X00000000 0XBFC3BAD1
0XC7147823 0X46756BD2 0X448659B3 0X00000000 0X00000000 0X3FCE418B
0XC7144C13 0X46814776 0X448659B3 0X00000000 0X00000000 0X3FCE418B
I need to swap endianess of every value, for example 0XC71F2A11
-> 0X112A1FC7
答案1
得分: 1
你可以使用正则表达式的查找和替换功能:
查找:(0X)([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})
替换:\1\5\4\3\2
[A-F0-9]
匹配在 A
到 F
或 0
到 9
之间的单个字符。
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论