Search Results

Search: Posts Made By: thomasraj87
2,660
Posted By Scrutinizer
With GNU awk 4 you can do this: $ awk -v wd=2...
With GNU awk 4 you can do this:
$ awk -v wd=2 '$wd~/[^ ]/{print $1, $wd}' FIELDWIDTHS="6 4 4 4 4 4 4" file
Name Mon
A Y
F Y
$ awk -v wd=3 '$wd~/[^ ]/{print $1, $wd}'...
5,057
Posted By RudiC
info sed: So - use the escaped \& sequence...
info sed:
So - use the escaped \& sequence there. And, for multiple search patterns, use a group regex with the * character:
sed 's/<td> \(&nbsp; \)*/<td> \&nbsp; /g' file
<tr> some td tags...
5,057
Posted By Corona688
-e is redundant here. If your SED supports...
-e is redundant here. If your SED supports extended regexps:

$ echo "&nbsp; &nbsp; &nbsp; a &nbsp; &nbsp; &nbsp;" | sed -r 's/(&nbsp; *)+/\&nbsp;/g'
&nbsp;a &nbsp;

$ The ( ) brackets group a...
5,057
Posted By RudiC
Corona688 is right - use the + repetition...
Corona688 is right - use the + repetition indicator instead of the * (which indicates zero or more repetitions).
5,057
Posted By Don Cragun
You could also try the following, which, other...
You could also try the following, which, other than copying the 1st line of your sample input file unchanged to the output, seems to create the output you said you want (and I don't understand from...
2,000
Posted By RavinderSingh13
Hello thomasraj87, As mentioned by RudiC...
Hello thomasraj87,

As mentioned by RudiC previously, kindly put your requirements all together in a single post with proper sample Input_file and proper expected output_file.

For your current...
2,000
Posted By Scrutinizer
@OP: And please do this right from the beginning...
@OP: And please do this right from the beginning when you start the thread.



--
The example in post #6 should also work with the extra tr tags:
awk '{p=$0} getline<f>0{$1=$1 p}1' FS='<td>'...
2,000
Posted By itkamaraj
paste file1 file2 $ awk...
paste file1 file2

$ awk 'NR==FNR{a[NR]=$0;next}{print a[FNR],$0}' file1 file2
1 text1
2 text2
3 text3
4 text4
2,826
Posted By complex.invoke
sed 's# \{1,\}#-#g' infile
sed 's# \{1,\}#-#g' infile
2,826
Posted By keb0x80
thomasraj87, try it with tr instead: tr...
thomasraj87,

try it with tr instead:

tr -s ' ' '-' < /tmp/1.txt
2,826
Posted By complex.invoke
-r is gnu sed only! try awk '{gsub("...
-r is gnu sed only!
try

awk '{gsub(" ","-")}1' infile
10,588
Posted By felipe.vinturin
Another way with "stty": $ cat noEchoPass.sh...
Another way with "stty":

$ cat noEchoPass.sh
sttySettings=`stty -g`
echo "Password: "
stty -echo
read pass
stty "${sttySettings}"
echo "pass: [${pass}]"
$ ./noEchoPass.sh
Password:
pass:...
10,588
Posted By itkamaraj
read -sp "password: " pass echo...
read -sp "password: " pass

echo $pass
Showing results 1 to 13 of 13

 
All times are GMT -4. The time now is 03:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy