Sponsored Content
Top Forums Shell Programming and Scripting Handling Unit Seperator Delimeter Post 302206517 by sviswana on Wednesday 18th of June 2008 01:42:13 AM
Old 06-18-2008
Getting Fractional part in Division

Hi,
I have a simple code as follows:
Percent_fail=`echo "scale=6; $Col_nm_cnt / $Line_cnt_lan" | bc`

Though I get the answer correcly as follows, I also get an error msg along with it as follows:
.333333
./test.ksh[14]: .333333: unexpected `.'

Can anyone please help me how to avoid this error message and why i get this message

Thanks in advance,
Sudha.
sviswana
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Awk Field Seperator Help

I wrote a script on HPUX 11.11 to turn a Decimal subnet mask (255.255.254.0) to hex 0xfffffe00 (subset of a bigger script). It works great on the HPUX systems but on the freebsd box the awk is not seperating the fields properly. I tried to google for a solution and seaching these forums i am just... (3 Replies)
Discussion started by: insania
3 Replies

2. Solaris

how i can use a WORD for seperator

hi, i want to use A WORD for seperator in awk or especially in cut. how i can perform this. is there any way to use a word for seperator. For example: i want to list all word after FROM and the files name contains this word. chatnorollback.svc: delete from info where nick ... (3 Replies)
Discussion started by: qrshat
3 Replies

3. Shell Programming and Scripting

Comma seperator

I am trying to create a new CSV file from an existing CSV file whose content is as follows: "1","Tom,Garry","111" "2","Tom,Garry","222" when i use Cat file | cut -d',' -f1,3 or awk to have only the 1st and 3rd column in my new CSV file, instead of creating a file content as "1","111"... (6 Replies)
Discussion started by: premar
6 Replies

4. UNIX for Dummies Questions & Answers

Using | as a seperator in join

I need to use | as a seperator in unix join command. i tried changing seperator using -t option but iit is not working. can u please help. (5 Replies)
Discussion started by: firvin
5 Replies

5. Shell Programming and Scripting

How to change field seperator

Hi Please help me out with this problem: I want to have a script that would change the nth field seperator in a line into something else. like a,d,4,2,97,8,9 into a,d,4,2,97/8/9 Thanks (2 Replies)
Discussion started by: onthetopo
2 Replies

6. Shell Programming and Scripting

Printing value with no obvious field seperator

Hi all, Can anybody think of a way to do this? I have a file with content like the following: F_TOP_PARAM_VALUEF_TOP_SOURCEF_TOP_DEL_NOTIFICATIONF_DEST_ADDRF_TOP_DEL_TYPE What I want to do is print out the value in the square brackets after F_TOP_SOURCE. So in this case I'd like to print... (4 Replies)
Discussion started by: Donkey25
4 Replies

7. Shell Programming and Scripting

SUBSEP Seperator problem with awk

The following code removes new line with in double quotes I am replacing newline character with in double quotes with 123. intermediatenewline_remover () { typeset Infile=$1 nawk -F"," '{ record = record $0 if ( gsub( /"/, "&", record ) % 2 ) { record = record "123" ... (3 Replies)
Discussion started by: pinnacle
3 Replies

8. Shell Programming and Scripting

Count the delimeter from a file and delete the row if delimeter count doesnt match.

I have a file containing about 5 million rows, in the file there are some records which has extra delimiter at random position. (we dont know the positions), now we have to Count the delimeter from each row and if the count of delimeter is not matching then I want to delete those rows from the... (5 Replies)
Discussion started by: Akumar1
5 Replies

9. Shell Programming and Scripting

Replacing the delimeter with other delimeter

Hi Friends, I have a file1.txt as below 29123973Ç2012-0529Ç35310124Ç000000000004762Ç00010Ç20Ç390ÇÇÇÇF 29123974Ç20120529Ç35310125Ç0000000000046770Ç00010Ç20Ç390ÇÇÇÇF 29123975Ç20120529Ç35310126Ç0000000000046804Ç00010Ç20Ç390ÇÇÇÇF 29123976Ç20120529Ç35310127Ç0000000000044820Ç00010Ç20Ç390ÇÇÇÇF i have a file2.txt... (4 Replies)
Discussion started by: i150371485
4 Replies

10. UNIX for Beginners Questions & Answers

Field seperator with awk

Hi, input data format: echo ' <APPLICATION="APPLSG" SUB_APPLICATION="DLY" JOBNAME="DPL_BN_RE_CCMS_SA" CMDLINE="run_job.ksh %%PARAM1 %%PARAM2" TASKTYPE="Command" />' expected format: "APPLSG", "DLY", "DPL_BN_RE_CCMS_SA", "run_job.ksh %%PARAM1 %%PARAM2" my command: echo ' ... (2 Replies)
Discussion started by: JSKOBS
2 Replies
Encode::TW(3pm) 					 Perl Programmers Reference Guide					   Encode::TW(3pm)

NAME
Encode::TW - Taiwan-based Chinese Encodings SYNOPSIS
use Encode qw/encode decode/; $big5 = encode("big5", $utf8); # loads Encode::TW implicitly $utf8 = decode("big5", $big5); # ditto DESCRIPTION
This module implements tradition Chinese charset encodings as used in Taiwan and Hong Kong. Encodings supported are as follows. Canonical Alias Description -------------------------------------------------------------------- big5-eten /big-?5$/i Big5 encoding (with ETen extensions) /big5-?et(en)?$/i /tca-?big5$/i big5-hkscs /big5-?hk(scs)?$/i /hk(scs)?-?big5$/i Big5 + Cantonese characters in Hong Kong MacChineseTrad Big5 + Apple Vendor Mappings cp950 Code Page 950 = Big5 + Microsoft vendor mappings -------------------------------------------------------------------- To find out how to use this module in detail, see Encode. NOTES
Due to size concerns, "EUC-TW" (Extended Unix Character), "CCCII" (Chinese Character Code for Information Interchange), "BIG5PLUS" (CMEX's Big5+) and "BIG5EXT" (CMEX's Big5e) are distributed separately on CPAN, under the name Encode::HanExtra. That module also contains extra China-based encodings. BUGS
Since the original "big5" encoding(1984) is not supported anywhere (glibc and DOS-based systems uses "big5" to mean "big5-eten"; Microsoft uses "big5" to mean "cp950"), a conscious decision was made to alias "big5" to "big5-eten", which is the de facto superset of the original big5. The "CNS11643" encoding files are not complete. For common "CNS11643" manipulation, please use "EUC-TW" in Encode::HanExtra, which contains planes 1-7. The ASCII region (0x00-0x7f) is preserved for all encodings, even though this conflicts with mappings by the Unicode Consortium. SEE ALSO
Encode perl v5.18.2 2013-11-04 Encode::TW(3pm)
All times are GMT -4. The time now is 02:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy