Search Results

Search: Posts Made By: atlantis_yy
1,040
Posted By jlliagre
The first line is using the same file as input...
The first line is using the same file as input and output. This lead to undefined behavior. Just use a different file as output and process that later one with awk.
1,040
Posted By Ygor
You could probably take out the $1=$1 since the...
You could probably take out the $1=$1 since the input and output field separators are the same.
9,879
Posted By bartus11
Try:awk -F\* -vt=`date +%m%d%y%H%M%S`...
Try:awk -F\* -vt=`date +%m%d%y%H%M%S` '$1=="ST",$1=="SE"{if($1=="ST"){close(f);f="sample"t"" ++i} ; $1=$1; print>f}' OFS=\| <filename>
1,749
Posted By Scrutinizer
Did you try my awk suggestion...
Did you try my awk suggestion (https://www.unix.com/302658747-post6.html)? Did that not work?
1,959
Posted By Scrutinizer
awk version: awk -F\*...
awk version:
awk -F\* '$1=="ST",$1=="SE"{if($1=="ST"){close(f);f="file" ++i} gsub(/~/,RS); $1=$1; print>f}' OFS=\| infile

--
On Solaris use /usr/xpg4/bin/awk rather than awk
1,959
Posted By Skrynesaver
change it into a Perl script that iterates over...
change it into a Perl script that iterates over the supplied arguments eg:

#!/usr/bin/perl

use strict;
use warnings;
for my $filename (@ARGV){
my $file_counter=0;
my $in_record=0;
...
Showing results 1 to 6 of 6

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