Search Results

Search: Posts Made By: Johanni
1,114
Posted By RudiC
Try sed 's/$/,/; s/\([^,]*\),\([^,]*,\)/\1.\2/g;...
Try sed 's/$/,/; s/\([^,]*\),\([^,]*,\)/\1.\2/g; s/,$//' file
1.188,1.250,0.757,0.946,8.960
1.257,1.300,0.802,1.002,9.485
1.328,1.350,0.846,1.058,10.021
1.381,1.400,0.880,1.100,10.418...
12,014
Posted By Corona688
I think you meant bytes, not bits :) awk...
I think you meant bytes, not bits :)

awk -F, '{printf("%8s%16s%16s%16s\n",$1,$2,$3,$4) }' file
1,542
Posted By rdcwayx
Get the init Coordinates.key: sed -n...
Get the init Coordinates.key:
sed -n '/\*NODE/,/\*/p' infile > Coordinates.key

But not sure, how many NODE sessions in Coordinates.key.
2,334
Posted By CarloM
sed '/Products from/ s/[^ [:alpha:]//g' infile ...
sed '/Products from/ s/[^ [:alpha:]//g' infile
(assuming you also want the spaces preserved, otherwise remove the space after ^)
1,275
Posted By Corona688
That's a useless use of cat, grep and any other...
That's a useless use of cat, grep and any other command which reads stdin is quite capable of reading a file without it. Just redirect in the shell.

while read ID
do
lynx -source...
5,335
Posted By CarloM
As I posted above, just add your fixed text...
As I posted above, just add your fixed text before the \n.
5,335
Posted By Corona688
Easier to just change the output record...
Easier to just change the output record separator:

awk -v ORS="\n\n" '1' infile.txt
5,335
Posted By CarloM
A blank line, or fixed/variable text? To be added...
A blank line, or fixed/variable text? To be added above all input lines, or every other input line?

If it's blank or fixed on every line, you could do something like:
awk '{printf "\n"; print}'...
3,506
Posted By balajesuri
wget -O output.html "www.unix.com"
wget -O output.html "www.unix.com"
2,402
Posted By jim mcnamara
Try this: sed 's/\]Facebook/Johan/g' ...
Try this:

sed 's/\]Facebook/Johan/g' inputfilename > newfilename
2,402
Posted By Scott
Not working, how? $ echo "]Facebook" |...
Not working, how?


$ echo "]Facebook" | sed 's/]Facebook/Johan/g'
Johan


What is the source of "]Facebook" - where does that come from - ] is suspiciously the ending of some control...
1,573
Posted By ahamed101
Try this... #!/bin/bash while read line ...
Try this...

#!/bin/bash
while read line
do
val=$( grep -A1 "$line" file1 | tail -1 )
echo ${val:-null}
done < file2
In case your grep doesn't support -A option, then replace...
966
Posted By ahamed101
Try this... awk '{gsub(/[...
Try this...

awk '{gsub(/[ ]*$/,"")}NR==FNR{x=$0;getline;getline;a[x]=$0;next}{print a[$0]?a[$0]:"null"}' file1 file2

file1 is the mobile feature
file2 is the feature list

HTH
--ahamed
1,643
Posted By birei
Hi Johanni, Try: $ sed -n '/pattern/,$...
Hi Johanni,

Try:

$ sed -n '/pattern/,$ p' infile
Regards,
Birei
3,808
Posted By CarloM
The separator for sed does not have to be '/' -...
The separator for sed does not have to be '/' - you can equally use '#' or whatever.
awk '{print "s#"$0"#spEC#g"}' words.dat
3,808
Posted By vgersh99
sed 's#^#s/#;s#$#/spEC/g#' myFile awk '{print...
sed 's#^#s/#;s#$#/spEC/g#' myFile
awk '{print "s/" $0 "/spEC/g"} myFile
3,808
Posted By CarloM
Just remove the comma: # awk '{print...
Just remove the comma:
# awk '{print $0"/spEC/g"}' words.dat
802.11a/spEC/g
802.11b/spEC/g
802.11g/spEC/g
802.11n/spEC/g
Also, you don't need 2 awk commands:
# awk '{print "s/"$0"/spEC/g"}'...
1,132
Posted By jayan_jay
expecting this .. $ echo "test[20]" | sed...
expecting this ..

$ echo "test[20]" | sed 's,\[20\],,g'
test
18,370
Posted By suresh.boddepu
TRY
(cat file |grep -v '[0-9]') ; (cat file|grep '[0-9]'| sed 's/,//g')
18,370
Posted By bartus11
perl -pe 's/(?<=\d),(?=\d)//g' file
perl -pe 's/(?<=\d),(?=\d)//g' file
1,291
Posted By Skrynesaver
use is a Perl command , try renaming the file...
use is a Perl command , try renaming the file data2.pl and then runchmod +x ./data2.pl to make the script runnable.

Probably not, the original script is intended to be runnable as follows...
...
1,291
Posted By Skrynesaver
The following would create your statement ...
The following would create your statement

You could use the DBI and DBD::mysql modules to add the values directly to the database.

WARNING CODE UNTESTED!!

#!/usr/bin/perl

use strict;...
Showing results 1 to 22 of 22

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