Edit Text

Hi everyone , i am new in shell scripting and i want to do a simple job.
A have in a file a text that looks like :

4770 maniac 20 0 13680 312 240 S 0.0 0.0 0:00.00 pro 4770 maniac 20 0 23448 312 240 S 0.0 0.0 0:00.00 pro 4770 maniac 20 0 33216 312 240 S 0.0 0.0 0:00.00 pro

and i want to break it in three lines:

4770 maniac 20 0 13680 312 240 S 0.0 0.0 0:00.00 pro
4770 maniac 20 0 23448 312 240 S 0.0 0.0 0:00.00 pro
4770 maniac 20 0 33216 312 240 S 0.0 0.0 0:00.00 pro

Any help would be appreciated :slight_smile:

sed 's/pro[ ]/pro\
/g' inputFile
1 Like

AWK....

awk '{for(i=1;i<=NF;i++){if($i=="pro"){printf $i"\n"}else {printf $i FS}}}'  inputfile