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
Locale::Codes::LangExt(3pm)				 Perl Programmers Reference Guide			       Locale::Codes::LangExt(3pm)

NAME
Locale::Codes::LangExt - standard codes for language extension identification SYNOPSIS
use Locale::Codes::LangExt; $lext = code2langext('acm'); # $lext gets 'Mesopotamian Arabic' $code = langext2code('Mesopotamian Arabic'); # $code gets 'acm' @codes = all_langext_codes(); @names = all_langext_names(); DESCRIPTION
The "Locale::Codes::LangExt" module provides access to standard codes used for identifying language extensions, such as those as defined in the IANA language registry. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default IANA language registry codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying language extensions. A code set may be specified using either a name, or a constant that is automatically exported by this module. For example, the two are equivalent: $lext = code2langext('acm','alpha'); $lext = code2langext('acm',LOCALE_LANGEXT_ALPHA); The codesets currently supported are: alpha This is the set of three-letter (lowercase) codes from the IANA language registry, such as 'acm' for Mesopotamian Arabic. This is the default code set. ROUTINES
code2langext ( CODE [,CODESET] ) langext2code ( NAME [,CODESET] ) langext_code2code ( CODE ,CODESET ,CODESET2 ) all_langext_codes ( [CODESET] ) all_langext_names ( [CODESET] ) Locale::Codes::LangExt::rename_langext ( CODE ,NEW_NAME [,CODESET] ) Locale::Codes::LangExt::add_langext ( CODE ,NAME [,CODESET] ) Locale::Codes::LangExt::delete_langext ( CODE [,CODESET] ) Locale::Codes::LangExt::add_langext_alias ( NAME ,NEW_NAME ) Locale::Codes::LangExt::delete_langext_alias ( NAME ) Locale::Codes::LangExt::rename_langext_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangExt::add_langext_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangExt::delete_langext_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes::API man page. SEE ALSO
Locale::Codes The Locale-Codes distribution. Locale::Codes::API The list of functions supported by this module. http://www.iana.org/assignments/language-subtag-registry The IANA language subtag registry. AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 2011-2012 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.2 2012-10-11 Locale::Codes::LangExt(3pm)
All times are GMT -4. The time now is 05:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy