Search Results

Search: Posts Made By: raychu65
1,854
Posted By raychu65
The following is my input file: ...
The following is my input file:





Report No.: AAA

BE NO: 111

asfsdflsjdfklsdjfklsjfklsfsflsjdlk
fsdfjsfkjsklfsfj




Report No.: AAA

BE NO: 111
1,854
Posted By raychu65
using nawk to concate the fields
I have the the following question:

# cat report.lis | nawk -F: '{ if($0 ~ "^BE NO:") print "report_"$2".lis"}' :confused:
.lisrt_ 111
.lisrt_ 111
.lisrt_ 222
.lisrt_ 222
.lisrt_ 333
.lisrt_...
3,721
Posted By raychu65
Split BIG report using nawk
I have the following nawk script:

nawk -F: '{ if($0 ~ "^Report No") {fl=1; i=0;}
if(fl==1){data[i]=$0; i++}
if($0 ~ "^BE NO:")
{
fname = "reprot_"$2".lis";
gsub(" ","",fname);...
5,509
Posted By raychu65
Thanks summer_cherry, I will try it!! ...
Thanks summer_cherry, I will try it!!

Actually, I have another question!!!
Let say my report.lis file like the following:

LINE # Report_code
1
2
3
4
5 Report No.: AAA...
5,509
Posted By raychu65
hi ranjithpr, The problem is solved, since I...
hi ranjithpr,

The problem is solved, since I don't know what happen for the source. However, I can solved now. Thanks a lot.
5,509
Posted By raychu65
hi ranjithpr, When I try to use nawk in my...
hi ranjithpr,

When I try to use nawk in my Solaris, the following code is fine for me.

nawk -F ':' '{ if($0 ~ "^Report No") {fl=1; i=0;}
if(fl==1){data[i]=$0; i++;}
if($0 ~ "^BE NO:")
{...
5,509
Posted By raychu65
Hi Tytalus, Would you mind to tell me how to...
Hi Tytalus,

Would you mind to tell me how to use the nawk in Solaris? Thanks
5,509
Posted By raychu65
error message: awk: syntax error near line 3 ...
error message:
awk: syntax error near line 3
awk: illegal statement near line 3
awk: syntax error near line 13
awk: illegal statement near line 13
awk: syntax error near line 16
awk: illegal...
5,509
Posted By raychu65
test: awk -F ':' '{ > if($0 ~ "^Report No") >...
test: awk -F ':' '{
> if($0 ~ "^Report No")
> {
> fl=1;
> i=0;
> }
> if(fl==1)
> {
> data[i]=$0;
> i++;
> }
> fname = "reprot_"$2".lis";
> gsub(" ","",fname);
> for(j=0;j<i;j++) print...
5,509
Posted By raychu65
Still not working, I am still getting the...
Still not working, I am still getting the following error:
awk: syntax error near line 1
awk: bailing out near line 1

I am using -- SunOS 5.10
5,509
Posted By raychu65
Even I type back my file name on it, I still got...
Even I type back my file name on it, I still got the following error:

awk: syntax error near line 1
awk: illegal statement near line 1
awk: syntax error near line 2
awk: bailing out near line 2...
5,509
Posted By raychu65
thanks ranjithpr But when I try your script,...
thanks ranjithpr

But when I try your script, I got the following error, please help again:

awk: syntax error near line 1
awk: illegal statement near line 1
awk: syntax error near line 2
awk:...
5,509
Posted By raychu65
Split a Big Report.
Hi All,

I am a newbie for Unix Script. I have report like the following: (file name: Report.txt):

Report No.: AAA

BE NO: 111

asfsdflsjdfklsdjfklsjfklsfsflsjdlk
fsdfjsfkjsklfsfj

Report...
Showing results 1 to 13 of 13

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