Sponsored Content
Operating Systems HP-UX Replacing Hex Characters In A File Using awk? Post 302899289 by AndyBSG on Monday 28th of April 2014 10:41:25 AM
Old 04-28-2014
Here is an example of the file in question

Code:
 
^A{1:F01BNPAGB20AXXX0000000000}{2:I103BARCGB20XXXXN}{3:{108:ORLD190077833XXX}}{4:^M
:20:CCT44195^M
:23B:CRED^M
:32A:140428GBP627,95^M
:33B:GBP632,95^M
:50K:/CH5708686001085122004/TR32793333^M
MSC CROCIERE SA^M
CHEMIN RIEU 12-14^M
GENEVE//CH^M
:52A:BPPBCHGGXXX^M
:57A:BARCGB20XXX^M
:59:/GB65BARC20789880480169^M
Gorkana Group Ltd^M
Discovery House,  28-42 EC1Y8QE Lon^M
don//GB^M
:70:MSC CROCIERE SA - Gorkana Group Ltd^M
. RIF. 647413 30/11/2013^M
:71A:SHA^M
:71F:GBP5,^M
-}^C                                                         ^A{1:F01BNPAGB20AXXX0000000000}{2:I103BARCGB20XXXXN}{3:{108:ORLD190077835XXX}}{4:^M
:20:CCT44196^M
:23B:CRED^M
:32A:140428GBP2703,88^M
:33B:GBP2708,88^M
:50K:/CH5708686001085122004/TR32793355^M
MSC CROCIERE SA^M
CHEMIN RIEU 12-14^M
GENEVE//CH^M
:52A:BPPBCHGGXXX^M
:57A:NWBKGB2LXXX^M
:59:/GB94NWBK50410145129827^M
Worldchoice Enterprises Ltd^M
Worldchoice House PE2 6FT PETERBORO^M
UGH//GB^M
:70:MSC CROCIERE SA - Worldchoice Enter^M
prises Ltd. RIF. 8375 21/10/2013^M
:71A:SHA^M
:71F:GBP5,^M
-}^C                                     ^A


Last edited by AndyBSG; 04-28-2014 at 11:47 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replacing all but last Hex characters in a text line

I must remove hex characters 0A and 0D from several fields within an MS Access Table. Since I don't think it can be done in Access, I am trying here. I am exporting a Table from Access (must be fixed length fields, I think, for my idea to work here) into a text format. I then want to run a... (2 Replies)
Discussion started by: BAH
2 Replies

2. HP-UX

Hex characters of ascii file

Hi, Whats the command or how do you display the hexadecimal characters of an ascii file. thanks Bud (2 Replies)
Discussion started by: budrito
2 Replies

3. UNIX for Dummies Questions & Answers

replacing few characters in a file

Hi All, I have huge xml file. The file contains some comment tags . I have requirement to replace comment tag with another comment tag. Say for example : file X has -- Part of the file <?xml version="1.0" encoding="ISO-2"?><translationResults jobDate="20070123 23:20:51"... (1 Reply)
Discussion started by: purnakarthik
1 Replies

4. Shell Programming and Scripting

Help Replacing Characters in Flat File

I was wondering if somebody could help me with something on UNIX. I have a file that looks like this - "nelson,bill","bill","123 Main St","Mpls","MN",55444,8877,william I want to replace all comma with pipes (|), except if the comma is within double quotes. (The first field is an example of... (8 Replies)
Discussion started by: nelson553011
8 Replies

5. UNIX for Dummies Questions & Answers

replacing the characters in a file

hi i want to replace the characters between positions 2 to 30 in each line in a file how to do it suggestions welcome (2 Replies)
Discussion started by: trichyselva
2 Replies

6. UNIX for Dummies Questions & Answers

Replacing characters in csv file

Hello all, This is my first post here, so please excuse me if this question is too obvious or has been asked before. I am new to Unix and although I tried to search your forum for the answer to my question, I could not find an answer that would help me. I have a 500MB csv file with numeric values... (1 Reply)
Discussion started by: finwhiz
1 Replies

7. Shell Programming and Scripting

replacing characters with awk

Hi there! I'm new in this and probably is a quite simple task but I still cannot manage to do it: I have to read some files line by line and then change the input format into another one, but the very first step is to replace the empty variables by error values. I mean, each line looks like:... (2 Replies)
Discussion started by: thoreman
2 Replies

8. Shell Programming and Scripting

Replacing hex characters '\x0D' with '\x0D\x0A'

Hello All, I have a requirement where I need to replaced the hex character - '\x0D' with 2 hex characters - 'x0D' & 'x0A' I am trying to use SED - But somehow its not working. Any pointers? Also the hex character '\x0D' can occur anywhere in the line. Can this also be accomplished... (6 Replies)
Discussion started by: paragkalra
6 Replies

9. UNIX for Dummies Questions & Answers

Replacing hex characters

I have the following file consisting of dates and sample measurements: 05��Oct��2010 1.31�� 06��Oct��2010 1.32�� 07��Oct��2010 1.31�� The hex characters are \xc2\xa0 in sequence. I have tried to remove the characters as follows: sed -i '' -e 's/\xc2\xa0//g' file.dat and as follows... (6 Replies)
Discussion started by: figaro
6 Replies

10. UNIX for Advanced & Expert Users

Replacing characters in a file

Suppose I have a file which has 1000 columns (5 SHOWN FOR EXAMPLE) two alphabets are separated by a space and then tab A A"\t"C C"\t"G G"\t"0 0"\t"T T A G"\t"C C"\t"G G"\t"A T"\t"0 0 G A"\t"0 0"\t"G C"\t"A A"\t"T C whenever there is a 0 0 in any column, the output should be printed as A... (12 Replies)
Discussion started by: rossi
12 Replies
SHASUM(1)						 Perl Programmers Reference Guide						 SHASUM(1)

NAME
shasum - Print or Check SHA Checksums SYNOPSIS
Usage: shasum [OPTION] [FILE]... or: shasum [OPTION] --check [FILE] Print or check SHA checksums. With no FILE, or when FILE is -, read standard input. -a, --algorithm 1 (default), 224, 256, 384, 512 -b, --binary read files in binary mode (default on DOS/Windows) -c, --check check SHA sums against given list -p, --portable read files in portable mode produces same digest on Windows/Unix/Mac -t, --text read files in text mode (default) The following two options are useful only when verifying checksums: -s, --status don't output anything, status code shows success -w, --warn warn about improperly formatted SHA checksum lines -h, --help display this help and exit -v, --version output version information and exit The sums are computed as described in FIPS PUB 180-2. When checking, the input should be a former output of this program. The default mode is to print a line with checksum, a character indicating type (`*' for binary, `?' for portable, ` ' for text), and name for each FILE. DESCRIPTION
The shasum script provides the easiest and most convenient way to compute SHA message digests. Rather than writing a program, the user simply feeds data to the script via the command line, and waits for the results to be printed on standard output. Data can be fed to shasum through files, standard input, or both. The following command shows how easy it is to compute digests for typical inputs such as the NIST test vector "abc": perl -e "print qw(abc)" | shasum Or, if you want to use SHA-256 instead of the default SHA-1, simply say: perl -e "print qw(abc)" | shasum -a 256 Since shasum uses the same interface employed by the familiar sha1sum program (and its somewhat outmoded anscestor md5sum), you can install this script as a convenient drop-in replacement. AUTHOR
Copyright (c) 2003-2008 Mark Shelor <mshelor@cpan.org>. SEE ALSO
shasum is implemented using the Perl module Digest::SHA or Digest::SHA::PurePerl. perl v5.12.4 2013-03-18 SHASUM(1)
All times are GMT -4. The time now is 01:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy