A file has >5K records always. Separated by "|", it has 30 fields for each line. In some lines, I am getting an odd field. say, the 15th field is supposed to be 2 characters but comes in as >2. In this case, for resolving this I need to copy the value of 25th field to the 15th. See below.
Output needed
Lines tried:
Never succeeded! Please advise.
Hi fellas and fella-esses...
There are numerous threads on here where people ask for, and often expect, solutions to difficult problems solved using _one_liners_.
Why do they insist as such when it is virtually no different in execution time with well thought out indented code?
Is it me... (12 Replies)
Hi All,
I got some awk one liners, how can i split it all into a nice script?
Got these:
gzcat capgw0.log-201308161376632741.gz | sed -n '/2013-08-16 05:56:/,/2013-08-16 05:58:/p' > timebased.log
awk -F":|," 'FNR==NR && /INFO - AId:/ {a=$0;next} END {for (i in a) print i "|" a}'... (8 Replies)
I wanted to say LOL and punch my face when I saw post#11 (where Don_Cragun even reduced the string manipulation with a simple regex) in the thread https://www.unix.com/shell-programming-scripting/220553-add-0-start-filename-2.html
I mean, when things can be done with just a one liner, sometimes I... (6 Replies)