The files is seperated by | pipe symbol
myfile.txt
Hello|how|are|you|hope|you|are|doing|fine
Lilly|jasmine|rose|sunflower|nightfire|flowers
I want to remove columns greater than 3. I want result set as
Hello|how|are
Lilly|jasmine|rose
In actual file i have to remove the extra columns more than 13 columns in each row. Using SED/AWK in unix shell scripting. Thanks !
cut
ting fields off feels for a task for cut (e.g.cat testfile | cut -d\| -f 1-3
). And why not in a shell script? Or did you mean awk, sed or bash. Or any shell?