Sponsored Content
Full Discussion: Characters in a single read
Top Forums UNIX for Dummies Questions & Answers Characters in a single read Post 302845495 by rajivn786 on Wednesday 21st of August 2013 03:33:46 PM
Old 08-21-2013
Characters in a single read

Hi,

I have the file which has the data :


Code:
accctaaccctaaccctaaccctaaccctaaccctaaccctaaccctaac
cctaacccaaccctaaccctaaccctaaccctaaccctaaccctaacccc
taaccctaaccctaaccctaaccctaacctaaccctaaccctaaccctaa
ccctaaccctaaccctaaccctaaccctaacccctaaccctaaccctaaa
ccctaaaccctaaccctaaccctaaccctaaccctaaccccaaccccaac
cccaaccccaaccccaaccccaaccctaacccctaaccctaaccctaacc
ctaccctaaccctaaccctaaccctaaccctaaccctaacccctaacccc
taaccctaaccctaaccctaaccctaaccctaaccctaacccctaaccct
aaccctaaccctaaccctcgcggtaccctcagccggcccgcccgcccggg
tctgacctgaggagaactgtgctccgccttcagagtaccaccgaaatctg

How many characters are in a single read?


Thanks.

Last edited by Scrutinizer; 08-21-2013 at 04:43 PM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read line with a single key press...

I would really like to have a script that will accept the key press from the user with out having to press the enter key afterwards. i.e. echo "Press Y to print \c" read YesNo At this point the user has to press the enter key to continue. Is there a way to accept the key press from the... (3 Replies)
Discussion started by: jagannatha
3 Replies

2. UNIX for Dummies Questions & Answers

Sed - Lower case single characters

Hello, I have a file where I am supposed to convert all the single i characters to uppercase, but when I try, it converts all the i's inside of words to uppercase as well. I tried doing: cat filename | sed 's/i/I/g' but that obviously does not work. Any help would be greatly... (6 Replies)
Discussion started by: zlindner
6 Replies

3. Shell Programming and Scripting

Read Single Value From File With Perl

Hi all, I have what I would have thought was a very simple problem but I can' find an elegant solution. I have a file which has a single value you in it, say 194. All I want my perl script to do is open the file, read the value and assign that value to a variable. I've done stuff like... (1 Reply)
Discussion started by: Donkey25
1 Replies

4. Shell Programming and Scripting

Multiple characters including single quote in delimiter

Hello, I need to replace the comma to something else between the single quote: 1aaa,bbb,'cc,cc','ddd',1 2aaa,bbb,'ccc','d,d',0 to 1aaa,bbb,'cc<comma>cc','ddd',1 2aaa,bbb,'ccc','d<comma>d',0 Can someone help? Thanks. (2 Replies)
Discussion started by: bgirl
2 Replies

5. Shell Programming and Scripting

Bash KeyPress (or Read Single Character)

Hi, I'm sorry if this has already been posted somewhere but I can't seem to find it on the forums (or anywhere on google :( ) I am writing a script where a user must enter a single character to perform an action. For example, Press Q to Quit or R to Refresh Basically I am stuggling... (5 Replies)
Discussion started by: Ste_Moore01
5 Replies

6. Shell Programming and Scripting

read single chars

This reads single keystrokes and produces an output: #! /bin/bash while : ; do read -s -n 1 >/dev/null 2>&1 echo ${REPLY} done | awk '{print}' This second one don't. Even though these examples make no sense; the real code is more complicated. Who knows what the problem is... (2 Replies)
Discussion started by: elbrand
2 Replies

7. Shell Programming and Scripting

Read Embedded Newline characters with read (builtin) in KSH93

Hi Guys, Happy New Year to you all! I have a requirement to read an embedded new-line using KSH's read builtin. Here is what I am trying to do: run_sql "select guestid, address, email from guest" | while read id addr email do ## Biz logic goes here done I can take care of any... (6 Replies)
Discussion started by: a_programmer
6 Replies

8. Shell Programming and Scripting

How to remove characters enclosed in single quotes?

How to remove characters enclosed in single quotes? My data is something like this (03/22/2011 08:17:26.650) : ( -> '1' -> '1-1-3' -> '6' -> '1' -> 'SALMOR58BB4' aaaaa bbbbbb ccccc ((dddd)) I want the output to be (03/22/2011 08:17:26.650) : ( -> -> -> -> -> aaaaa... (2 Replies)
Discussion started by: rdhanek
2 Replies

9. Shell Programming and Scripting

how to read multi line characters in a single column

Hi, I have file in which fields are pipe (|) separated and the record separator is new line (\n). But sometime I am getting a field value which is spread across multiple line. Basically I am getting a file from another system in the below format and needs to process the file and load data into a... (3 Replies)
Discussion started by: satyaatcgi
3 Replies

10. Shell Programming and Scripting

Read 2 input and produce it in single ouput?

Hi all. I’ve 2 inputs here and would like to produce it in single ouput. I’ve drafted simple shell script but not sure how to put all this together. The final output should be “GROUP-XYZ” instead of “TEST” Please advise. INPUT1 GROUP-XYZ INPUT2 type8code0@box:~/dbedit$ cat... (8 Replies)
Discussion started by: type8code0
8 Replies
eucset(1)						      General Commands Manual							 eucset(1)

NAME
eucset - set and get code widths for ldterm SYNOPSIS
HP15-codeset] or or or or [cswidth] ] DESCRIPTION
The command sets or gets (reports) the encoding and display widths of the Extended UNIX Code (EUC), UCS Transformation Format (UTF8), or GB18030 characters processed by the current input terminal. EUC is an encoding method for codesets composed of single or multiple bytes. EUC permits applications and the terminal hardware to use the 7-bit US ASCII code and up to three single byte or multibyte codesets simul- taneously. ldterm is a STREAMS terminal line discipline module which obtains codeset information from See ldterm(7). The cswidth value defines the character widths for codesets. If cswidth is not implicitly or explicitly defined by passing no argument to the command, the cswidth value is determined by the following criteria in descending priority: 1. Use the cswidth value stored in the current locale, if defined. 2. Use predefined cswidth values if the codeset name defined in the locale is GB18030, UTF8, or one of the four HP15 codesets. 3. Use the environment variable if defined and in the correct format. 4. Use 7-bit US ASCII as the default codeset and its cswidth value. This command must be used to specify EUC or non-EUC codesets, whether they are single byte or multibyte. However, the command can correctly set the cswidth parameter without using any options in most cases except for ASIAN_UTF8. See the section for special warnings on the val- ues of the cswidth argument. For the GB18030, ASIAN_UTF8, or UTF8 setting, use the option. Options The command recognizes the following options and arguments: Displays the current settings of the EUC character widths for the terminal. Sets the width to one of the four HP15 codesets, or or The HP15 codesets supported are and cswidth Defines the character widths for codesets 1 through 3. See the section in this manpage for more information. EUC Code Set Classes EUC divides codesets into four classes. Each codeset has two characteristics: the number of bytes for encoding the characters in the code- set, and the number of display columns to display the characters in the codeset. All characters within a codeset possess the same charac- teristics. ASIAN_UTF8 is used for setting double width display, and UTF8 is used for single width. o Codeset 0 consists of all 7-bit, single byte ASCII characters. The most significant bit of each of these characters is 0 (zero). Characters in codeset 0 require one byte for encoding, and occupy one display column. These values are fixed for codeset 0 (zero). The 7-bit US ASCII code is the primary EUC codeset, which is available to users without direct specification. o Codeset 1 is a supplementary EUC codeset. Codeset 1 characters have an initial byte whose most significant bit is 1. Characters in codeset 1 may require more than one byte for encoding, and may require more than one display column. The command must be used to set the characteristics for codeset 1. o Codesets 2 and 3 are supplementary EUC codesets. Characters in these codesets have an initial byte of SS2 or SS3, respectively. They require more than one byte for encoding, and may require more than one display column. The command must be used to set the characteristics for codesets 2 and 3. The cswidth argument in the command line is a character string that describes the character widths for codesets 1 through 3. This command does not allow the user to modify the settings for codeset 0. The character string is of the following format: X1[:Y1],X2[:Y2],X3[:Y3] X1 The number of bytes required to encode a character in codeset class 1. Y1 The number of display columns needed to display characters in this class. X2 The number of bytes required to encode a character in codeset 2, not counting the SS2 byte, Y2 The number of display columns for codeset 2 characters. X3 The number of bytes needed to encode characters in codeset 3, not counting the SS3 byte, Y3 The number of display columns required for these characters. The values for the column widths may be omitted if they are equal to the number of encoding bytes. If the encoding value of any of the EUC codesets is set to (zero), then the codeset does not exist. See the section for special warnings on the values of the cswidth argument. If no cswidth argument is supplied, the command uses the value of the environment variable. If this variable is not present, the following default string is substituted: This default string designates that the environment uses a single byte EUC codeset that has characters in the EUC codeset 1 format. If the environment uses a multibyte EUC codeset in the codeset 1 format, single byte or multibyte EUC codesets in the codeset 2 or 3 format, or both, the default setting cannot be used. EXTERNAL INFLUENCES
Environment Variables Provide a default value for the internationalization variables that are unset or null. If is not specified or is set to the empty string, a default of (see lang(5)) is used instead of If any of the internationalization variables contain an invalid setting, behaves as if all internation- alization variables are set to See environ(5). If set to a nonempty string value, override the values of all other internationalization variables. Determines the locale that should be used to affect the format and contents of diagnostic messages written to standard error and informative messages written to standard output. Determines the location of message catalogs for the processing of EXAMPLES
To display the encoding and display widths for the EUC codesets 1 to 3 in your environment, enter: Assuming has been previously used to set for the entry generates the following: To change the current settings of the encoding and display widths for the EUC characters in codesets 1 and 2 to two bytes each, enter one of the following: To set the encoding and display widths for the EUC characters in the locale enter: For enter: For enter: To set the code width to that of enter: To set the code width to that of enter: To set the code width to that of enter: WARNINGS
The cswidth argument does not include the SS2 or SS3 bytes in the byte width values. This command is not specified by standards, may not be available on other vendor's systems, and may be subject to change or obsolescence in a future release. AUTHOR
was developed by OSF and HP. SEE ALSO
dtterm(1), ldterm(7). eucset(1)
All times are GMT -4. The time now is 04:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy