Search Results

Search: Posts Made By: sameeribraimo
1,834
Posted By sameeribraimo
Columns to Rows
I want to create a script with gawk.

I have the following file with 2 columns:


A 1
A 2
A 3
B 1
B 2
B 3
C 1
C 2
D 1
D 2
D 3
D 4

and i want to convert to:
4,760
Posted By sameeribraimo
I'm working on windows so i change: NR==1{ ...
I'm working on windows so i change:

NR==1{
print;nf=NF;next
}
FNR==1{next}
nf!=NF{
system("del -f outfile"); exit
}1

and error is:

The process can not access the file because it...
4,760
Posted By sameeribraimo
Thanks in advance. If the files have the...
Thanks in advance.

If the files have the same number of columns it works fine.
But if any file does not have the same number of columns gives error

i have error:
'0 Is not recognized as an...
4,760
Posted By sameeribraimo
I believe that I did not explained well. ...
I believe that I did not explained well.

What I want is the following:

file1.txt:
a b c
1 1 1
2 2 2
3 3 3
4 4 4

file2.txt:
a b c
5 5 5
6 6 6
7 7 7
8 8 8

file3.txt:
a b c
4,760
Posted By sameeribraimo
can send me please the code integrated that...
can send me please the code integrated that before processing all files validate the headers - number of columns is equal in all.

Only creates or process the new merged file if the number of...
4,760
Posted By sameeribraimo
Thanks But can I validate that the number of...
Thanks

But can I validate that the number of columns of each file is the same?
4,760
Posted By sameeribraimo
gawk: Merge N files into one
hi all!

i'm an awk newbie and have been trying in vain to merge N files together.

ie.

file1.txt:
a b c
1 1 1
2 2 2
3 3 3
4 4 4

file2.txt:
a b c
5 5 5
6 6 6
7 7 7
8 8 8
Showing results 1 to 7 of 7

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