Search Results

Search: Posts Made By: pxalpine
2,367
Posted By Yoda
awk ' { a[NR]=$0; }...
awk ' {
a[NR]=$0;
} /eee/ {
f = 1;
} !/eee/ && !/fff/ {
f = 0;
} /fff/ && f {
...
4,760
Posted By Yoda
tr '\t' '\n' < filename
tr '\t' '\n' < filename
2,314
Posted By rdrtx1
try: while read f l do printf "<value>"...
try:
while read f l
do
printf "<value>" >> $f.xml
for w in ${l%[.]}
do
printf "<token>$w</token>" >> $f.xml
done
printf "</value>\n" >> $f.xml
done < input
3,183
Posted By kurumi
sed -n '/^x[0-9][0-9][0-9][0-9][0-9]/!p' file
sed -n '/^x[0-9][0-9][0-9][0-9][0-9]/!p' file
2,570
Posted By Franklin52
Looks like a dos/win file, remove the CR's first...
Looks like a dos/win file, remove the CR's first with tr, try this:
tr -d '\r' < file | sed 's/[,.]*$/./'
2,570
Posted By Ikon
Try this: awk '!/\.$/{sub(/$/,...
Try this:

awk '!/\.$/{sub(/$/, ".")};{print}' myfile.txt


EDIT:
Hmm, didnt see the comma, sorry.

EDIT:
This works..

awk 'sub(/,$/, "") || !/\.$/{sub(/$/, ".")};{print}' myfile.txt
Showing results 1 to 6 of 6

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