Help with shellscript


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with shellscript
# 1  
Old 12-29-2012
Linux Help with shellscript

I am new in shell script i want to convert .txt file
in the format
PHP Code:
axsjdijdjjdk 
to

PHP Code:
a
x
s
j
d
i
j
d
j
j
d

# 2  
Old 12-29-2012
Code:
awk '{ for(i=1; i<=length($0 );i++) {print substr($0,i,1) } } ' oldfile > newfile

# 3  
Old 12-29-2012
Code:
sed 's/\(.\)/\1\n/g' -i filename


Last edited by Scott; 12-30-2012 at 01:41 AM.. Reason: Removed link
# 4  
Old 12-30-2012
try also:
Code:
awk '$1=$1' FS= OFS="\n" input.txt

---------- Post updated at 11:22 PM ---------- Previous update was at 10:51 PM ----------

also, more sed:
Code:
sed 's/./&\n/g' input.txt


Last edited by rdrtx1; 12-30-2012 at 01:19 AM..
# 5  
Old 12-31-2012
thank u all

is there any way to handle unicode such as ʃʰɐm̆
# 6  
Old 12-31-2012
Both example in post #4 does handle your unicode text, giving on characters pr line.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk in shellscript

Dear Members, I have the following situation I do not understand: I have a large json encoded file which I need to grep and afterwards want to extract specific information. I use this command to to that: cat /tmp/file | awk -F '"fields":' '{print $2}' | awk -F '"description":' '{print $4}'... (6 Replies)
Discussion started by: crumble
6 Replies

2. Shell Programming and Scripting

'*' not working in shellscript

Hi, To Archive files, I try to move files from one directory to another directory . So i used the below logic, #!/bin/ksh ****Archive***** mv ${DATA_DIR}/ABC_.dat ${ARCHIVE} So if i give the complete file name its working fine. But if i use '*', im getting the below error, mv:... (18 Replies)
Discussion started by: Bopty
18 Replies

3. Shell Programming and Scripting

Needed shellscript for the following

hi all, i need the shell script for he below requirement i had the input file as a_20121217_035120( frmat is a_date_hhmmss) a_20121217_035128 a_20121217_035456 a_20121217_035767 a_20121217_035178 a_20121217_035189 a_20121217_035220 my output should be a_20121217_035456... (0 Replies)
Discussion started by: hemanthsaikumar
0 Replies

4. Post Here to Contact Site Administrators and Moderators

help with backup shellscript

can any one advice on this.. create archive backup -yyyymmdd.tr.gzin the directory "backup" that includes the following directory " product/dev","product/uat"and product/maintain", yymmdd, stand for current date This archive needs to be perpared at 9PM every day Thanks advance (1 Reply)
Discussion started by: ksakil
1 Replies

5. Shell Programming and Scripting

Shellscript Reengineering

Dear Community, I've an urgent issue due to a migration of an application from HP-Unix to Linux. We have a mass of scripts which are running at a dedicated server on hpunix. Now we do not know, which further scripts exists on this machine. the idea is, that we crawl through the scripts we... (1 Reply)
Discussion started by: Alibapir
1 Replies

6. Shell Programming and Scripting

Automation of UI using shellscript

Hi, I want to do automation on UI using shellscript. eg: 1) Drop down menu contains assign , investigate, closed. now there is one id want assign it using assign tab then need to investigate it and lastly close. Sometimes the id can't assign to perticular user. there are so many... (11 Replies)
Discussion started by: aish11
11 Replies

7. Shell Programming and Scripting

Need help with shellscript

Hello. I am a novince at writing shell scripts but here is the question. I have to write a shell script that does the following: Once executed via crontab, the script should do the following: a. get date/time stamp in for format 10-MAR-05 and b. execute shell script my_script.sh (which... (2 Replies)
Discussion started by: jigarlakhani
2 Replies

8. UNIX for Advanced & Expert Users

shellscript problem

hI, Pls consider the following shell script #!/bin/csh -f sqlplus tkyte/tkyte <<"EOF" > tmp.csh set serveroutput on declare a number:=5; begin dbms_output.put_line( 'a:='||a ); end; / spool off "EOF" The above script does the followin 1)it connects... (1 Reply)
Discussion started by: ravi raj kumar
1 Replies
Login or Register to Ask a Question