How to I get the nth character from a string in shell script. For instance, I have a string London. I want to get, say the first character (L) from the string. How do I do this in unix shell?
Thankx (4 Replies)
I need a script for...
how to find a position of column data and print some string in the next line and same position
position should find based on *HEADER8* in text
for ex: ord123 abs 123 987HEADER89 test234
ord124 abc 124 987HEADER88 test235
... (1 Reply)
Hello everyone this is my first post of many to come :)
I am writing a script and in this script at one point i need to replace a character in a particular position in a string for example:
in the string "mystery" i would need to replace the 3rd position to an "r" so the string becomes... (3 Replies)
Suppose there are two files:
A, format is like:
line1 12
line2 33
line3 6
...
B, format is like:
>header
taaccctaaccctaaccctaacccaaccccaccccaaccccaaccccaac
ccaaccctaaccctaaccctaacccaaccctaaccctaaccctaacccaa
ccctcaccctcaccctcaccctcaccctcaccctcaccctcaccctaacc... (1 Reply)
Hi,
i want find the character '-' in a file from position 284-298, if it occurs i need to replace it with 'O ' for the position in the file. How to do that using SED command.
thanks in advance,
Sara (9 Replies)
I see a millioin ways to do this with echo, but what I wan to do is assign a variable the "nth" character of an incoming parameter to a ksh script.
$1 will be "pia"
I need to assign the first character to stmttype. (10 Replies)