Search Results

Search: Posts Made By: m_wassal
4,281
Posted By guruprasadpr
Hi Is it something like this you wanted: ...
Hi

Is it something like this you wanted:

$ cat file
12
23
34
56
09
ab
cd

Output:

$ awk 'NR%3{ if (x)x=x","$0;else x=$0;next;}{print x","$0;x=""}END{print x}' file
12,23,34...
3,938
Posted By Scrutinizer
awk 'NR==1{getline x<f}NR==x{print;getline x<f}'...
awk 'NR==1{getline x<f}NR==x{print;getline x<f}' f=file file1 > file2

- We are are reading all lines in "file1"
- If we are reading line 1 from "file1" then read the variable x from f (which is...
3,938
Posted By binlib
awk 'FNR==NR{n[$0];next}FNR in n' file file1 >...
awk 'FNR==NR{n[$0];next}FNR in n' file file1 > file2
Showing results 1 to 3 of 3

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