Search Results

Search: Posts Made By: kevintse
2,671
Posted By Franklin52
To replace all new line characters of a file you...
To replace all new line characters of a file you can use xargs:
xargs < file > newfile
2,671
Posted By Scott
:q is a label (called q), N reads the next line...
:q is a label (called q), N reads the next line (the two lines now also contain the newline character, which the substitution (s) will remove), t q go's back (t) to the label q in the event that the...
1,814
Posted By ctsgnb
As ROHON said: What happen when check ing...
As ROHON said:

What happen when check ing "a" :
does in match 0 or more occurrence of [0-9] ?
answer : yes, it matches 0 occurrence of [0-9] ...

you should go for the [0-9][0-9]* instead ...
1,814
Posted By
[0-9]* means 0 or more occurrence. to match...
[0-9]* means 0 or more occurrence.

to match 123 u have to write [0-9]+ or [0-9][0-9]* means 1 or more occurrence.
2,014
Posted By clx
Please try: while read num f1 f2 do ...
Please try:

while read num f1 f2
do
if [ -s "$f1" ] && [ -s "$f2" ]; then
echo $num
fi
done < file

-s will check for non zero size too. if you dont want to do that. just use -f
9,359
Posted By alister
Change: print "$k:" . join (",", @v); To: ...
Change:
print "$k:" . join (",", @v);

To:
print "$k:" . join (",", @v[0..($#v>19?19:$#v)]);

Regards,
Alister
9,359
Posted By aigles
Try this awk program which doesn't use the split...
Try this awk program which doesn't use the split function :awk -v Q="'" -F'[:,]' '
BEGIN {
cmd = "sort -k3,3nr -k2,2 | awk " Q "{ out=out (NR==1 ? $1 \":\" : \",\") $2 } END { print out }" Q;
}...
9,359
Posted By alister
It seems to me that both files contain the same...
It seems to me that both files contain the same information, though in different formats. A simpler solution would be to use a different algorithm, which builds an internal list of book-pairs in one...
Showing results 1 to 8 of 8

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