10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello All,
I have this file with the below contents
1|2|3|4|
this|that|which|what|
when I use, sed 's/|/\t/g' infile
I get,
1t2t3t4t
thistthattwhichtwhatt
Why is this?? :confused: :wall: (13 Replies)
Discussion started by: PikK45
13 Replies
2. Shell Programming and Scripting
Hello,
I have this sentence :Pattern1 Pattern2 Pattern3 Pattern4-which-contains-HELLO-string-and-other-stuff-and-second-HELLO-and-third-HELLO
I want to delete everything between the 3rd tab (\t) and the FIRST pattern "HELLO" of the line.
Result expected is : Pattern1 ... (7 Replies)
Discussion started by: theclem35
7 Replies
3. Shell Programming and Scripting
i am using the default sed package that comes with solaris. (11 Replies)
Discussion started by: chidori
11 Replies
4. Shell Programming and Scripting
Hi all,
I'm new to Unix and work primarily in bioinformatics. I am in need of a script which will allow me to replace "1" with "chr1" in only the first column of a file which looks like such:
1 10327 rs112750067 T C . PASS ASP;RSPOS=10327;... (4 Replies)
Discussion started by: Hkins552
4 Replies
5. Shell Programming and Scripting
Input:
gstreamer-plugins-good
gstreamer-plugins-bad
gstreamer-plugins-ugly
sed 's/\n/\t/g' infile
It's not working.
Output should be:
gstreamer-plugins-good gstreamer-plugins-bad gstreamer-plugins-ugly (5 Replies)
Discussion started by: cola
5 Replies
6. Shell Programming and Scripting
Hi
I am struggling to find a solutions to this problem:
I have a directory full of files and I wish to:
read each line of each file and
if any one line in those files is longer than 72 characters I want to replace any tab characters with a space character.
Ive been... (3 Replies)
Discussion started by: benackland
3 Replies
7. Shell Programming and Scripting
Hi,
how to replace new line with tab in sed ...
i used
sed -e 's/\n/\t/g' <filename >
but its not working (1 Reply)
Discussion started by: mail2sant
1 Replies
8. UNIX for Dummies Questions & Answers
Anyone know how to represent tabs when doing subsitutions in sed? I have tried using \t but it doesn't seem to work. (11 Replies)
Discussion started by: handak9
11 Replies
9. UNIX for Dummies Questions & Answers
I try to remove empty lines from file and use next:
> cat fl.dat|grep -v '^*$'
or
cat fl.dat|sed '/^*$/d'
'grep' does not removes lines with tabs, 'sed' - lines with <tab> and with <spc>
Why it could be?
Is there any option/env-var should I check?
Thank you
Alex (5 Replies)
Discussion started by: alex_5161
5 Replies
10. Shell Programming and Scripting
Hi,
I'm using the following to insert lines into file:
sed ${rowNr}i'\
first row\
second row\
third row\
' file.txt
How can I add tab in front of each added line? "\t" or actual TAB does not seem to work?
Thanks! (2 Replies)
Discussion started by: Juha
2 Replies