Search Results

Search: Posts Made By: scottaazz
3,083
Posted By scottaazz
Remove the "<>" around the file names dd...
Remove the "<>" around the file names

dd if=File1.dat of=File1Final.dat cbs=95 conv=unblock
1,645
Posted By scottaazz
All in awk: awk '{ $1 = $1 ".txt" ;if...
All in awk:

awk '{ $1 = $1 ".txt" ;if (a[$1]) { a[$1] = a[$1] "\n"; }; a[$1] = a[$1] "Fi Na=" $2 " no=" $3;} END { for (i in a) { print "Hello\nprl\n" a[i] "\nbye\nq" > i } }' A.txt
30,092
Posted By scottaazz
the unix command "head" is made for that type of...
the unix command "head" is made for that type of operation. Use the following operation.

to remove the last two line of a file use:

head -n-2 yourfile
12,782
Posted By scottaazz
You were close in your piece of code... use...
You were close in your piece of code...

use
awk '$1 ~ "\\."' file
1,968
Posted By scottaazz
You may want to write an awk script... put...
You may want to write an awk script...

put the following into a file "filter.awk"
{
if ($0 ~ /^-/) { dash++ } else { if (dash==1) {out[++outcnt] = sprintf("%s %s",$1, $2) } }
if...
1,969
Posted By scottaazz
awk '{ if ($14 ~ /-/) {gsub("-","",$14);...
awk '{ if ($14 ~ /-/) {gsub("-","",$14); gsub("$","-",$14) } print }' yourfile
2,809
Posted By scottaazz
It is not good programming practice to perform...
It is not good programming practice to perform the read/write the way you describe but the following will fix it (yes, you need both "close" statements)

BEGIN{FS=OFS="|"; myfile =...
Showing results 1 to 7 of 7

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