Search Results

Search: Posts Made By: zvtral
4,574
Posted By Chubler_XL
This should be a bit more optimised: ...
This should be a bit more optimised:
CDR_INDEX=/zpool1/NFS/INDEX/${1}
CDR_SCRIPT=/zpool1/NFS/script/${1}
LIST=SAMPLE

cd ${CDR_SCRIPT}
for i in `cat ${LIST}`
do
/usr/xpg4/bin/awk -F ":"...
3,875
Posted By Chubler_XL
Try: sed -i '1i#!/bin/bash' testing.sh
Try:

sed -i '1i#!/bin/bash' testing.sh
2,557
Posted By agama
I think this sed should do the trick: ...
I think this sed should do the trick:



# bsd style sed
sed -E 's/(.*[0-9])(\|)([0-9].*)/\1\3/' input-file >output-file


# gnu style sed
sed -r 's/(.*[0-9])(\|)([0-9].*)/\1\3/' ...
1,887
Posted By balajesuri
perl -ne 's/^\n/302::\|NULL\n/; print $_'...
perl -ne 's/^\n/302::\|NULL\n/; print $_' inputfile

Sorry, the above code snippet would not work as per requirement. My mistake.. Didn't read it thoroughly.
2,010
Posted By itkamaraj
while read line do lno=$(echo $line | cut...
while read line
do
lno=$(echo $line | cut -d: -f1)
fname=$(echo $line | cut -d: -f2)
nawk -v lno="$lno" 'NR==lno{print;exit}' ${fname} >> filer
done < input.txt
1,471
Posted By MR.bean
awk -F: '$3 ~ /^20/ {print $0}' input_file
awk -F: '$3 ~ /^20/ {print $0}' input_file
1,471
Posted By jayan_jay
A little more compact .. ;) $ awk -F:...
A little more compact .. ;)

$ awk -F: '$3~/^20/' infile
2,087
Posted By agama
This should work: awk ' match( $1, "812|"...
This should work:


awk ' match( $1, "812|" ) { printf( "%d: %s\n", NR, $1 ); } ' input-file


Replaced the $ in the match which will match the 812 followed by the pipe symbol.

You could...
1,773
Posted By Franklin52
awk -F, '$1==var || $2==var' OFS=","...
awk -F, '$1==var || $2==var' OFS="," var="1252468812" file > newfile
mv newfile file
Forum: Red Hat 11-11-2011
6,331
Posted By ygemici
i assume , your nfsserver is OK ,at the now try...
i assume , your nfsserver is OK ,at the now try some issues on the nfs client

* check traffic between nfsserver and your client# tracepath nfsserver
or try nfswatch# yum install nfswatch &&...
Forum: Programming 07-13-2011
1,955
Posted By radoulov
You may try something like this: # cat...
You may try something like this:

# cat /tmp/data.txt
doni|student|westjava|123412|lombok|
iwan|student|westjava|1234412|utankayu|
rio|student|westjava|12342|cempedak|
# mysql -uroot -p t...
1,086
Posted By ctsgnb
ls | sed 's/.*\([0-9]\{8\}\).*/\1.txt/' for...
ls | sed 's/.*\([0-9]\{8\}\).*/\1.txt/'

for i in *
do
mv $i $(echo $i | sed 's/.*\([0-9]\{8\}\).*/\1.txt/')
done
1,086
Posted By yazu
Try this with GNU sed: $ cat >testfile ...
Try this with GNU sed:

$ cat >testfile
BDG.20110627.653212.txt
3GSMG.21.32.20110620.34112.3211.txt
MDN.000.234.123.20110619.2313.3.txt
$ sed -r 's/.*\.(20[0-9]{6})\..*/\1.txt/' testfile...
1,651
Posted By yazu
awk -F'|' '{print $1 > "file.one"; print $3 "|"...
awk -F'|' '{print $1 > "file.one"; print $3 "|" $4 > "file.two"}'
1,651
Posted By Shell_Life
cut -d'|' -f1 input_file > index_years.txt cut...
cut -d'|' -f1 input_file > index_years.txt
cut -d'|' -f3,4 input_file > index_nm.txt
2,699
Posted By ctsgnb
The ++ could even be omitted (useless) : ...
The ++ could even be omitted (useless) :

nawk -F: 'NR==FNR {L[$1];next}$1 in L' file1 file2
2,699
Posted By aigles
You can do something like that : $ cat...
You can do something like that :

$ cat fileA.txt
23
34
35
55
59
$ cat fileB.txt
23:klm|azer|000|601
24:asd|ekkk|001|001
123:bca|egsd|210|002
1231:cas|egds|322|231
35:xyz|abc|999|224...
Showing results 1 to 17 of 17

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