Hi all,
I'm not sure if this is the right forum, but i'll give it a try.
Here is my problem:
i have two files having basically the same things in it (hostnames):
File 1
mituap01
mituap02
mituap03
File 2:
mituap01
mituap04
mituap05
my goal is to get a .py out to check if pcs' in... (0 Replies)
Hi
i have a variable 'reform' and store the lines like
reform= {
record
string(8) ID;
string(4) PRD;
date("YYMMDD", split = "800101") DateofManufact;
string(4) PRDC_MODULE_NUM;
string(1) END_OF_RECORD = "\n";
}
I need to search for the character "\n"in the above variable... (1 Reply)
My question is so simple:
A = raw_input("A ")
if A == '56':
VAR = (A + 54)/13
else:
print "other operations"
if I write in input 5656565656
i want to make some arithmetic operations if the first input is 56XXX
but the output is
TypeError: cannot concatenate 'str' and... (2 Replies)
Hi,
I am beginner to Unix.
My requirement is to validate the encoding used in the incoming file(csv,txt).If it is encoded with UTF-8 format,then the file should remain as such otherwise i need to chnage the encoding to UTF-8.
Please advice me how to proceed on this. (7 Replies)
I have a file command.txt. It's content are as follows:-
The content of file is actually a command with script name and respective arguments.
arg1 and arg2 are dummy arguments , format : -arg arg_value
test is a argument specifying run mode , format : -arg
In my python code, i read it and... (1 Reply)
I want to check if the string is WINDOWS-1251 or UTF-8
can you help me to find the string encoding???
or maybe to get URL Content-Type charset with wget?
this is my function on PHP
function check_utf8($str) {
$len = strlen($str);
for($i = 0; $i < $len; $i++){
$c =... (2 Replies)
Hi,
I am trying to remove lines once a string is found till another string is found including the start string and end string. I want to basically grab all the lines starting with color (closing bracket). PS: The line after the closing bracket for color could be anything (currently 'more').... (1 Reply)
Hi,
I have a python variable with a value like this :
string = "abc.de.fghijk.com:zyz.ab.fgfijk.com:abc.ef.fghijk.com"
They are hostnames separated by the special character ":" . From this string I want to make a list with values : (2 Replies)
Hi all!!
I´m using command file -i myfile.xml to validate XML file encoding, but it is just saying regular file . I´m expecting / looking an output as UTF8 or ANSI / ASCII
Is there command to display the files encoding?
Thank you! (2 Replies)
Hi I was hoping some one would know if it is possible to url encode a string using sed?
My problem is I have extracted some key value pairs from a text file with sed, and will be inserting these pairs as source variables into a curl script to automatically download some xml from our server.
My... (5 Replies)
Discussion started by: Paul Walker
5 Replies
LEARN ABOUT MOJAVE
base64
base64(n) Text encoding & decoding binary data base64(n)
__________________________________________________________________________________________________________________________________________________NAME
base64 - base64-encode/decode binary data
SYNOPSIS
package require Tcl 8
package require base64 ?2.4.2?
::base64::encode ?-maxlen maxlen? ?-wrapchar wrapchar? string
::base64::decode string
_________________________________________________________________DESCRIPTION
This package provides procedures to encode binary data into base64 and back.
::base64::encode ?-maxlen maxlen? ?-wrapchar wrapchar? string
Base64 encodes the given binary string and returns the encoded result. Inserts the character wrapchar every maxlen characters of
output. wrapchar defaults to newline. maxlen defaults to 76.
Note well: If your string is not simple ascii you should fix the string encoding before doing base64 encoding. See the examples.
The command will throw an error for negative values of maxlen, or if maxlen is not an integer number.
::base64::decode string
Base64 decodes the given string and returns the binary data. The decoder ignores whitespace in the string.
EXAMPLES
% base64::encode "Hello, world"
SGVsbG8sIHdvcmxk
% base64::encode [string repeat xyz 20]
eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6
eHl6eHl6eHl6
% base64::encode -wrapchar "" [string repeat xyz 20]
eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6
# NOTE: base64 encodes BINARY strings.
% set chemical [encoding convertto utf-8 "Cu2088Hu2081u2080Nu2084Ou2082"]
% set encoded [base64::encode $chemical]
Q+KCiEjigoHigoBO4oKET+KCgg==
% set caffeine [encoding convertfrom utf-8 [base64::decode $encoded]]
BUGS, IDEAS, FEEDBACK
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category base64
of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for
either package and/or documentation.
KEYWORDS
base64, encoding
CATEGORY
Text processing
COPYRIGHT
Copyright (c) 2000, Eric Melski
Copyright (c) 2001, Miguel Sofer
base64 2.4.2 base64(n)