10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Unix File is pipe delimited with 17 fields. We may get extra pipes in data also.
We may get \n char (1 or more \n in one field or multi fileds) in data in any field.
Need to replace \n true ( line separator) with 'space and bell char space' chars (' \a ') Not data \n.
Input:... (1 Reply)
Discussion started by: rajeshkumare
1 Replies
2. UNIX for Dummies Questions & Answers
Input eg:
Ouput Expected.
The #rd line had the unexpted new line, which need to be replaced with space.
I was planing to go with checking the length of each line using awk and if the length is less than the defeined limit, (12 in above case) will replace the newline with space.
... (5 Replies)
Discussion started by: deepakwins
5 Replies
3. Shell Programming and Scripting
Hi,
i have a huge file that need to check for a pattern that occur more than once in a line like below:-
#lkk>cd-m>A0DV0>192.134.1.1 blablabladsdjsk
jshdfskfslfs
#lqk>cd-m>A1SV0>192.14.11.1 blalalbnalablab
balablablajakjakjakja
#pldqw>sf-w>PH67FR>168.55.1.1 balablabala... (5 Replies)
Discussion started by: redse171
5 Replies
4. Shell Programming and Scripting
for eg:
i have i/p file as:
================
i
wnt
to
change end of line
=================
my require ouput is like:
i wnt to change end of line
==================== (7 Replies)
Discussion started by: RahulJoshi
7 Replies
5. Shell Programming and Scripting
Hi !
I'm rather new with sed ... learned a lot already by googling etc ...
The following script should replace all spaces and ends-of-lines with "something (see below).
#!/bin/bash
i=0
while read line
do
fam="H`printf "%06d" $i`"
echo $line | sed -e 's//\t'$fam'\n/g'
i=$(($i+1))... (7 Replies)
Discussion started by: jossojjos
7 Replies
6. UNIX for Advanced & Expert Users
Problem: I have a lot of files, the files first line should always have 4 spaces before any text. Occasionally some of the files will miss the leading spaces and it's a problem. This is only in the first line.
So if there are 4 spaces then text, do nothing. If there are not 4 spaces, add 4... (2 Replies)
Discussion started by: Vryali
2 Replies
7. Shell Programming and Scripting
Hello Experts,
I am working on a small file editing script. Since all experts here are very generous to give me the complete code, I would take up the problem in steps so that I ensure my opportunity to learn.
AIM: The script has some commented and some uncommented lines. I need to :
... (2 Replies)
Discussion started by: hkansal
2 Replies
8. 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
9. Shell Programming and Scripting
please help in making sed singleline command
i need to insert dos new line (CR LF) before
" 34 matching device(s) found on \\cpu1."
" 6 matching device(s) found on \\cpu7."
" 102 matching device(s) found on \\mainserver."
the problem is that sometimes there are both CR LF before strings and... (1 Reply)
Discussion started by: xserg
1 Replies
10. Shell Programming and Scripting
i have a file named as templist which looks like this:
i want to translate spaces to a new line so that the file would look like this
im using sed with this sed -e 's/" "/\n/' templist > templist.out but it doesn't work. can someone please help me. (2 Replies)
Discussion started by: dakid
2 Replies