![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| read a variable character by character, substitute characters with something else | vipervenom25 | UNIX for Dummies Questions & Answers | 2 | 06-06-2008 12:18 PM |
| Can i read a file character by character | karnan | Shell Programming and Scripting | 6 | 05-18-2008 11:22 PM |
| bash while read how to remove \n character | papasj | Shell Programming and Scripting | 2 | 02-24-2008 08:01 AM |
| Read First Character of Each Line in File | azelinsk | Shell Programming and Scripting | 7 | 07-11-2007 05:15 PM |
| need to read 3° character from a text file | piltrafa | UNIX for Dummies Questions & Answers | 15 | 07-26-2005 07:19 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Can I read a file character by character?
Hello all respected people,
Can i read a file character by character without using sed,awk and perl commands. Thanks in advance. |
| Forum Sponsor | ||
|
|
|
||||
|
Code:
#! /bin/ksh
typeset -L1 single
while read line
do
while (( ${#line} > 0 ))
do
single="$line"
# do what you like with $single
echo $single
line=${line#$single}
done
done < input.txt
|