I need a better way to read the first character of each line in a file and check if it equals the special character ¤. This character tells me where there is a break in the reports. The file has over 500,000 lines. Currently, this is my code -
if ]
I am using Korn Shell as a scripting... (7 Replies)
im having trouble doing this:
i have a variable with 2 characters repeating e.g. aababbbaaaababaabbaabbba
is there a way i can search the variable for a's and b's and then change a's to b's and b's to a's?
im guessing its like getting the 1's compliment of the string
im doing this in... (2 Replies)
Can someone help me to write a script / command to read in a file, character by character, replace any unknown ASCII characters with space. then write out the file to a new filename/
Thanks! (1 Reply)
I have a text file like this
...
B 16 1.340E+05
A 18 3.083E+02
Wu123 1.365E+02
...
I would like to get rid of the 7th character of each line if this is a space character.
Thank you,
Sarah (5 Replies)
hello all
i request you to give the solution for the following problem..
I want read the text file.and print the contents character by character..like if the text file contains google means..i want to print
g
go
goo
goog
googl
google
like this Using unix Shell scripting...
without using... (1 Reply)
Hi Experts,
I have called file1.txt contains below
CREATE TABLE "IHUBDEV2"."TLM_BREAK_RULES"
( "OID" VARCHAR2(32) NOT NULL ENABLE,
"TLM_PAY_CLASS_OID" VARCHAR2(32) NOT NULL ENABLE,
"PUNCHED_BREAKS" NUMBER(1,0) DEFAULT 0 NOT NULL ENABLE,
"NORMAL_BREAKS"... (3 Replies)
Hi,
Maybe this iscorrect forum for my question...
I should read one character at a fixed position from each line of the file. So how ??? should be substituted in the code below:
while read line ; do
single_char=`???`
echo "$single_char"
done < $input_file
OK...I did get an... (0 Replies)
Hi,
My Requirement is to read the filenames which possess space charatcer in it and pass the same file name to the other shell script as input parameter.
Please provide your valuable suggestion. (5 Replies)
Hi:)
I have a large file ( couple thousand lines ) and I'm trying to add a character after the first word/space on each line.
eg:
First line of text
Second line of text
Third line of text
Fourth line of text
Fifth line of text
I'd like to accomplish:
First - line of text
Second... (8 Replies)
Discussion started by: martinsmith
8 Replies
10. Post Here to Contact Site Administrators and Moderators
I have Index Line and I tried to get the 9th character from the file and to check the character is "|" or not.
Shell Scripting.
Sample Index file.
"91799489|K8E|188.004.A.917994892.1099R.c.01.pdf|2013|10/15/2014|002|B|C|C"... (3 Replies)
Discussion started by: pavand
3 Replies
LEARN ABOUT OPENSOLARIS
print
print(1) User Commands print(1)NAME
print - shell built-in function to output characters to the screen or window
SYNOPSIS
ksh
print [-Rnprsu [n]] [arg]...
ksh93
print [-Renprs] [-f format] [-u fd] [string...]
DESCRIPTION
ksh
The shell output mechanism. When no options are specified, or when an option followed by ' a - is specified, or when just - is specified,
the arguments are printed on standard output as described by echo(1).
ksh93
By default, print writes each string operand to standard output and appends a NEWLINE character.
Unless, the -r, -R, or -f option is speciifed, each character in each string operand is processed specially as follows:
a Alert character.
Backspace character.
c Terminate output without appending NEWLINE. The remaining string operands are ignored.
E Escape character (ASCII octal 033).
f FORM FEED character.
NEWLINE character.
Tab character.
v Vertical tab character.
\ Backslash character.
x The 8-bit character whose ASCII code is the 1-, 2-, or 3-digit octal number x.
OPTIONS
ksh
The following options are supported by ksh:
-n Suppresses new-line from being added to the output.
-r-R Raw mode. Ignore the escape conventions of echo. The -R option prints all subsequent arguments and options other than -n.
-p Cause the arguments to be written onto the pipe of the process spawned with |& instead of standard output.
-s Cause the arguments to be written onto the history file instead of standard output.
-u [ n ] Specify a one digit file descriptor unit number n on which the output is placed. The default is 1.
ksh93
The following options are supported by ksh93:
-e Unless -f is specified, process sequences in each string operand as described above. This is the default behavior.
If both -e and -r are specified, the last one specified is the one that is used.
-f format Write the string arguments using the format string format and do not append a NEWLINE. See printf(1) for details on how to
specify format.
When the -f option is specified and there are more string operands than format specifiers, the format string is reprocessed
from the beginning. If there are fewer string operands than format specifiers, then outputting ends at the first unneeded for-
mat specifier.
-n Do not append a NEWLINE character to the output.
-p Write to the current co-process instead of standard output.
-r Do not process sequences in each string operand as described above.
-R
If both -e and -r are specified, the last one specified is the one that is used.
-s Write the output as an entry in the shell history file instead of standard output.
-u fd Write to file descriptor number fd instead of standard output. The default value is 1.
EXIT STATUS
The following exit values are returned:
0 Successful completion.
>0 Output file is not open for writing.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO echo(1), ksh(1), ksh93(1), printf(1), attributes(5)SunOS 5.11 27 Mar 2008 print(1)