10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Team
below test file contains tab delimeter file and i am excepting the number of files 3.
File : test.txt
a b c
awk -vFPAT='\t' -vOFS="\t" -v a="0" -v b="10" ' NR>a {if (NF != b ) print NR"@"NF }' test.txt
current output is
1@2
required output is
1@3
Cloud you please help... (7 Replies)
Discussion started by: bmk123
7 Replies
2. UNIX for Beginners Questions & Answers
My file looks like
3 33 210.01.10.0 2.1 1211 560 26 45 1298 98763451112 15412323499 INPUT OK
3 233 40.01.10.0 2.1 1451 780 54 99 1876 78787878784 15423210199 CANCEL OK
Aim is to replace the spaces in each line by tab
Used: sed -e 's/ */\t/g'
But I get output like this... (3 Replies)
Discussion started by: sa@@
3 Replies
3. Shell Programming and Scripting
Hi,
Need help on replacing every second instance of delimeter.
Scenario:
var="Name1,Value1,Name2,Value2,Name3,Value3,Name4,Value"
I want every second "," to replace with "|"
I tried like below
echo $var| sed 's/,/|/2'
But, it's not working.
Expected output:
... (4 Replies)
Discussion started by: Sumanthsv
4 Replies
4. UNIX for Dummies Questions & Answers
My data is jumbled up in the following way. I want to replace only the first two occurrences of space sets (may be a single space also) in every line with a single tab, please help. I want to be able to import the tab delimited columns into excel.
Input
a b c d e f g h i line1
j k ... (1 Reply)
Discussion started by: gina.lizar
1 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I have a space delimited text file but I only want to change the first space to a tab and keep the rest of the spaces intact. How do I go about doing that? Thanks! (3 Replies)
Discussion started by: evelibertine
3 Replies
6. Shell Programming and Scripting
Hi
I need to write a small script to kill the process id of particular job in one shot ,
Example
> ps
PID TTY TIME COMMAND
16280 pts/70 0:00 sh
16278 pts/70 0:00 rlogind
16197 pts/70 0:00 ps
1234 pts/70 0:00 runflow
2341 pts/70 0:00 runflow
12673 pts/70 ... (6 Replies)
Discussion started by: mani_isha
6 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. Shell Programming and Scripting
i have a file which contains text as shown below....
aaa|bbb|ccc|ddd|
cccc|ddddd|eeeee|ffffff
want to convert pipe symbol to tab like
aaaa bbbb cccc ddddd
ccccc ddddd eeeee ffffffffff
i tried with sed
sed 's/|/\t/g' file_name ...but i could not... (1 Reply)
Discussion started by: srikanthus2002
1 Replies
9. UNIX for Dummies Questions & Answers
you know like if you want to work on a specified field in the password file. you would specify the field your interested in my telling the script that the fields are separated by a colon. now, my problem is that I want to specify a field that is not separated by a colon but by a space or tab... (1 Reply)
Discussion started by: TRUEST
1 Replies
10. UNIX Desktop Questions & Answers
How do I replace a tab with a space in scripts using sed/awk ? (1 Reply)
Discussion started by: avnerht
1 Replies