Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Sorry, I haven't been able to hobble this together... Post 302924174 by gusbrown on Thursday 6th of November 2014 06:15:30 PM
Old 11-06-2014
Sorry, I haven't been able to hobble this together...

I have a file containing about 100 lines, each with a ';' the end.

Each line is a string represented in UTF-16 hex and they vary in length.

I am thinking I ought to be able to use (g)awk to insert ',00,' after each two characters on each line in the file so that in the end, I have a comma-delimited UTF-16LE hex file:

From:
Code:
224C6F72656D20697073756D20646F6C6F722073697420616D65742C20636F6E73656374657475722061646970697363696E6720656C69742E2050656C6C656E74657371756520697073756D206D617373612200;
224C6F72656D20697073756D20646F6C6F722073697420616D65742C20636F6E73656374657475722061646970697363696E6720656C69742E2050656C6C656E74657371756520697073756D206D617373612200;

To:
Code:
22,00,4C,00,6F,00,72,00,65,00,6D,00,20,00,69,00,70,00,73,00,75,00,6D,00,20,00,64,00,6F,00,6C,00,6F,00,72,00,20,00,73,00,69,00,74,00,20,00,61,00,6D,00,65,00,74,00,2C,00,20,00,63,00,6F,00,6E,00,73,00,65,00,63,00,74,00,65,00,74,00,75,00,72,00,20,00,61,00,64,69,00,70,00,69,00,73,00,63,00,69,00,6E,00,67,00,20,00,65,00,6C,00,69,00,74,00,2E,00,20,00,50,00,65,00,6C,00,6C,00,65,00,6E,00,74,00,65,00,73,00,71,00,75,00,65,00,20,00,69,00,70,00,73,00,75,00,6D,00,20,00,6D,00,61,00,73,00,73,00,61,00,22,00,00;
22,00,4C,00,6F,00,72,00,65,00,6D,00,20,00,69,00,70,00,73,00,75,00,6D,00,20,00,64,00,6F,00,6C,00,6F,00,72,00,20,00,73,00,69,00,74,00,20,00,61,00,6D,00,65,00,74,00,2C,00,20,00,63,00,6F,00,6E,00,73,00,65,00,63,00,74,00,65,00,74,00,75,00,72,00,20,00,61,00,64,69,00,70,00,69,00,73,00,63,00,69,00,6E,00,67,00,20,00,65,00,6C,00,69,00,74,00,2E,00,20,00,50,00,65,00,6C,00,6C,00,65,00,6E,00,74,00,65,00,73,00,71,00,75,00,65,00,20,00,69,00,70,00,73,00,75,00,6D,00,20,00,6D,00,61,00,73,00,73,00,61,00,22,00,00;

I've fiddled around all day (on and off) and have nothing to show for my efforts. If any of you can show me the way, I'd be most appreciative.

Thanks,

gus

Moderator's Comments:
Mod Comment Please use code tags

Last edited by jim mcnamara; 11-06-2014 at 10:37 PM.. Reason: code tags
 

2 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

haven`t the right of root?

I install solaris 8. I want to use netconfig command, but it dispear "you haven`t the right",why? Is there somebody can help me? (3 Replies)
Discussion started by: yycokr
3 Replies

2. Shell Programming and Scripting

I thought I asked the question before but I haven't sorry

:D could any one answer my previous question... just looked through logg and found no such question that I had asked.. please any input would help \.. :confused: (2 Replies)
Discussion started by: moxxx68
2 Replies
All times are GMT -4. The time now is 09:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy