Search Results

Search: Posts Made By: eboye
14,016
Posted By Scrutinizer
sh is not the same as bash, so either use: bash...
sh is not the same as bash, so either use:
bash test.sh
or
./test.sh
To be able to execute the latter command you need to make the script executable first using chmod.
14,016
Posted By RudiC
bash provides many functionalities that sh does...
bash provides many functionalities that sh does not, for instance "process substitution" that you use in your code sample.
You need to output to two files, and paste those, or you need to play dirty...
4,529
Posted By RudiC
Don't know if it's relevant, but in his sample in...
Don't know if it's relevant, but in his sample in post #1 the requestor had input line 3 printed before input line 2, which any proposal so far ignored, and even the R. did not insist upon in his...
4,529
Posted By Yoda
Set OFS as well and try: awk...
Set OFS as well and try:
awk 'BEGIN{c=0;FS="\t";OFS="\t"}{c++}c<3{ORS=FS}c==3{ORS=RS;c=0}1' file
4,529
Posted By Don Cragun
Here are three different awk scripts to do this...
Here are three different awk scripts to do this making different assumptions about the number of columns/row, and width of columns. If you input data is always less that 8 output columns per input...
4,529
Posted By Yoda
awk 'BEGIN{c=0}{c++}c<3{ORS=FS}c==3{ORS=RS;c=0}1'...
awk 'BEGIN{c=0}{c++}c<3{ORS=FS}c==3{ORS=RS;c=0}1' filename
If you want the results to be tab separated, then try:
awk 'BEGIN{c=0;FS="\t"}{c++}c<3{ORS=FS}c==3{ORS=RS;c=0}1' file
Note: Use nawk...
Showing results 1 to 6 of 6

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