Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Awk > split word in c...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 5 Topic 2230 of 2236
Post > Topic >>

split word in characters

by Nezhate <mazouz.nezhate@[EMAIL PROTECTED] > May 6, 2008 at 02:52 AM

Hi guys,
I've a small script that takes some data from file and split each word
in characters. There is 1 word per line in file.
For example, file contains 2 words:
Linux
foo

the result must be :

L
i
n
u
x
f
o
o

to do this I used the next command, but it fails
awk '{for (i=1;i<=NF;i++) {for (j=1;j<=length($i);j++) {print
$i[j] } } } }' read_text.txt




 5 Posts in Topic:
split word in characters
Nezhate <mazouz.nezhat  2008-05-06 02:52:55 
Re: split word in characters
Ed Morton <morton@[EMA  2008-05-06 05:00:25 
Re: split word in characters
pk <pk@[EMAIL PROTECTE  2008-05-06 12:03:42 
Re: split word in characters
Ed Morton <morton@[EMA  2008-05-06 05:34:04 
Re: split word in characters
Nezhate <mazouz.nezhat  2008-05-06 03:38:11 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed May 14 13:10:29 CDT 2008.