Search Results

Search: Posts Made By: stinkefisch
2,212
Posted By rdrtx1
try: awk '$1=$1' OFS="\n" infile | awk 'l ~ /D...
try:
awk '$1=$1' OFS="\n" infile | awk 'l ~ /D 8888 4[34] ./ {sub(".*D 8888 4", "D 8888 4", l) ;print l; l="";} {l=l $1 " ";}
END {if (l ~ /D 8888 4[34] ./) {sub(".*D 8888 4", "D 8888 4", l) ;print...
2,212
Posted By RudiC
Are those <new line>s real or just artefacts due...
Are those <new line>s real or just artefacts due to you NOT using code tags? If artefacts, trygrep -o "D 8888 4[43] [^ ]*" file4
D 8888 43 BBBBBBBBBBBBBB
D 8888 44 AAAAA4FFBBBBBB
D 8888 44...
7,317
Posted By Aia
sed 's/\(.\{16\}\).\{16\}/\1AAAAAAAA/' file ...
sed 's/\(.\{16\}\).\{16\}/\1AAAAAAAA/' file

The cat command is not necessary since sed can read a file on its own.
The red part is matching another 16 characters, and when you \1 those 16...
6,814
Posted By RudiC
You need to give the search pattern something to...
You need to give the search pattern something to replace. With BREs:sed 's/\(.\{8\}\).\{8\}/\1AAAAAAAA/' file
gtwrhtrdAAAAAAAArjytwyejtyjejetjyetgeaEHT
wrehrhw2AAAAAAAAytekutkyukrylryilruilrGEQTH...
8,135
Posted By Scrutinizer
That is because $line is used unquoted and thus...
That is because $line is used unquoted and thus subject to field splitting by the shell (so only the first field will be part of the sed script in quotes).

Try:
sed "/#KEYWORD/a email =...
27,983
Posted By Scrutinizer
Try this: awk...
Try this:
awk '{for(i=1;i<=NF;i++)if($i~/pattern/)print $(i+1)}' infile
2,835
Posted By jim mcnamara
you mean "test" in one column? awk...
you mean "test" in one column?

awk '{printf("%80s %s\n", $1, $2) } ' inputfilename


This assumes your data sample is correct: there are only two "words" on a line
2,198
Posted By bartus11
awk 'NR==FNR||FNR==1{printf $0;next}{printf...
awk 'NR==FNR||FNR==1{printf $0;next}{printf ",%s",$0}' File2 File1 > File3
Showing results 1 to 8 of 8

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