Search Results

Search: Posts Made By: giannicello
11,319
Posted By Scrutinizer
You're welcome! There are many ways of coding the...
You're welcome! There are many ways of coding the same solution. My last suggestion is just a different approach. I was focussing on the error message, also because there was no input file specified...
11,319
Posted By Scrutinizer
I wanted to help you find the problem with the...
I wanted to help you find the problem with the awk script you were writing, but that does not mean it cannot be done with awk.
Would this be more in the direction?
awk -F,...
11,319
Posted By Scrutinizer
Hi, there should be double quotes around "%s". To...
Hi, there should be double quotes around "%s". To get the space you can use printf "%s" $1 OFS ; or use printf "%s " $1;
11,870
Posted By vgersh99
awk '{ v=substr($0, 48,10)+0; print...
awk '{ v=substr($0, 48,10)+0; print substr($0,1,7),substr($0,8,30),v,substr($0,59,4)substr($0,64,2)substr($0,67,2)OFS}' OFS='|' a.txt
11,870
Posted By ctsgnb
sed...
sed 's:0:|0:;s:ccyy-mm-dd0*:|:;s:P:|:;s:-::g;s:[A-Z]*$:|:' a.txt$ cat a.txt
123456701234567890abcdefghijklmnopqrsccyy-mm-dd0000000001Pccyy-mm-ddABCDEFGH...
11,870
Posted By anbu23
$ awk '{ v=substr($0, 48,10); gsub("^0*","",v);...
$ awk '{ v=substr($0, 48,10); gsub("^0*","",v); print substr($0,1,7)"|"substr($0,8,30)"|" v "|"substr($0,59,4)substr($0,64,2)substr($0,67,2)"|"}' file ...
11,870
Posted By Chubler_XL
gsub dosn't return a string result, it updates...
gsub dosn't return a string result, it updates variable in place so do gsub on your variable before the print.

awk '{ v=substr($0, 48,10); gsub("^0*","",v);
print...
Showing results 1 to 7 of 7

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