Search Results

Search: Posts Made By: stayalive
3,777
Posted By stayalive
Thanks guys. I will try those options !!!!
Thanks guys. I will try those options !!!!
3,777
Posted By stayalive
That did not help. $ cat test3 ...
That did not help.

$ cat test3
123|aaa|a1|a2|a5|a6
222|b
b
b|b1|b2|b3|b4
333|ccc|c1|c2|c3|c4
444|ddd|d1|d2|d3|d4

$ awk -F"|" 'NF<6{ORS=" ";n+=NF;print}n==7{printf "\n";ORS="\n";n=0}NF==6'...
3,777
Posted By stayalive
This is my sample file: $ cat test3 ...
This is my sample file:

$ cat test3
123|aaa|a1|a2|a5|a6
222|bbb|b1|b2|b3|b4
333|ccc|c1|c2|c3|c4
444|ddd|d1|d2|d3|d4

I add line feeds to the 2nd line :
$ cat test3
123|aaa|a1|a2|a5|a6...
3,777
Posted By stayalive
bartus11 - any idea why this code does not remove...
bartus11 - any idea why this code does not remove linefeeds from the very first line?
3,777
Posted By stayalive
I get nawk: can't open file NF<n{ORS="...
I get

nawk: can't open file NF<n{ORS=" ";p=1}NF==1{p=1}NF==n&&p{printf "\n";ORS="\n";p=0}1

---------- Post updated at 03:23 PM ---------- Previous update was at 03:22 PM ----------

works on...
3,777
Posted By stayalive
If my number of columns is in a shell variable...
If my number of columns is in a shell variable num_cols, how do I reference that from this awk code?
3,777
Posted By stayalive
Thanks guys. I guess as long as I know the number...
Thanks guys. I guess as long as I know the number of columns in the record, I can tweak this awk code to strip out linefeeds embedded in columns.
3,777
Posted By stayalive
Help with removing embedded linefeeds
Greetings all,

i have csv file with pipe separated columns

SSN|NAME|ADDRESS|FILLER
123|abc|myaddress|xxx
234|BBB|my
add
ress
broken up|yyy

In the example above, the second record is...
Showing results 1 to 8 of 8

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