Search Results

Search: Posts Made By: dvah
1,268
Posted By jim mcnamara
for file in * do ccm cr $file <<EOF ascii ...
for file in *
do
ccm cr $file <<EOF
ascii
EOF
done

I dont know ccm, but this structure is called a here document, the delimiter is EOF, but it can be anything the shell will not interpret,...
1,094
Posted By cambridge
How about... awk '$1 ~ /^"/ && $1 !~ /"$/...
How about...
awk '$1 ~ /^"/ && $1 !~ /"$/ {next} 1' myfile

---------- Post updated at 03:53 PM ---------- Previous update was at 03:49 PM ----------

If you have any lines with a double quote...
2,529
Posted By pravin27
sed '/^($/d' inputfile
sed '/^($/d' inputfile
3,606
Posted By linuxhitman
I had a similar problem with a list of IP...
I had a similar problem with a list of IP addresses. Best solution I was able to come up with was:

TMPFILE=$(mktemp /tmp/rbip.XXXXXX)

sort -n -t '.' -k 1,1 -k 2,2 -k 3,3 -k 4,4 <ip_list|uniq...
3,606
Posted By bartus11
sort -k 1,1 -u file > file.tmp; mv file.tmp...
sort -k 1,1 -u file > file.tmp; mv file.tmp file
1,524
Posted By bartus11
awk '/create table/{x=$3}{$0=x":"$0}1'...
awk '/create table/{x=$3}{$0=x":"$0}1' file
2,086
Posted By pravin27
perl -pnle 's/(extent|lock).*(.)$/$2/g' inputfile
perl -pnle 's/(extent|lock).*(.)$/$2/g' inputfile
8,317
Posted By bartus11
You can do the same with Perl: perl -i -pe...
You can do the same with Perl: perl -i -pe 's/search/replace/g' file1
2,017
Posted By bartus11
Try: awk -v FILE1="$TMP_FILE2"...
Try: awk -v FILE1="$TMP_FILE2" '$0=="{"{system("cat "FILE1)} {print $0}' < $TMP_FILE
2,017
Posted By bartus11
Try: awk 'NR==4{system ("cat File2")}1'...
Try: awk 'NR==4{system ("cat File2")}1' File1
838
Posted By clx
Try awk -v cnt=$COUNT -F"|" '{ if ( NF != cnt...
Try
awk -v cnt=$COUNT -F"|" '{ if ( NF != cnt ){print NR; exit} }'
or
awk -F"|" '{ if ( NF != '$COUNT' ){print NR; exit} }'
838
Posted By panyam
awk -F"|" -v C=$COUNT '{ if ( NF != C ){print NR;...
awk -F"|" -v C=$COUNT '{ if ( NF != C ){print NR; exit} }'
4,189
Posted By yinyuemi
cat ref_file.txt table1|6| table2|10| ...
cat ref_file.txt
table1|6|
table2|10|

cat table1.unl
xx|xx|xxx|xxx|xx|xxx|
xx|xxxx|
xxx|xx|xx|xxxxxx|

cat table2.unl
xx|xx|xxx|xxx|xx|xxx|
xx|xxxx|
xxx|xx|xx|xxxxxx|x|x|x|x|x|x|
...
4,189
Posted By ctsgnb
sed 's/|/ /g' ref_file.txt | while read a b do ...
sed 's/|/ /g' ref_file.txt | while read a b
do
nawk -v X="$b" '(NF!=X){print $NR":"$0}' "$a".unl
done
4,189
Posted By durden_tyler
$ $ $ # display the contents of ref_file.txt ...
$
$
$ # display the contents of ref_file.txt
$ cat ref_file.txt
table1|6|
table2|10|
$
$
$ # display the contents of table1.unl
$ cat table1.unl
xx|xx|xxx|xxx|xx|xxx|
xx|xxxx|...
8,781
Posted By Corona688
Good to know. How about awk 'BEGIN { RS="" ;...
Good to know. How about awk 'BEGIN { RS="" ; FS="\n" } { for(N=1; N<=NF; N++) printf("%s,", $N); printf("\n"); }' < csvrec.csv then?
8,781
Posted By yinyuemi
awk '{printf NF?$0:"\n"}'
awk '{printf NF?$0:"\n"}'
Showing results 1 to 17 of 17

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