I don't think you can have a swiss army knife solution to a wild card problem. Please decently describe the data conents / structure in all cases, for every case, in detail. Are above the only three cases, or are there more? Is that pipe symbol enclosed in spaces or not always? Could it be used as a field separator? WIll the more-than-four-line data always be using braces to enclose the last field? One level of braces only?
You seem to want to print sth. like
in the "good cases". What should be the output in the "FAILED" cases? What in the multiline case?
You could use sth. like this to get the full records to operate upon:
Hi,
I have data with broken lines:
Sample data:
"12"|"25"|"a"|"b"|"c"|"d"|"e"|"f"|"2453748"|"08:10:50"
"16"|"25"|"a"|"b"|"c"|"d"|"e"|"f"|"
2453748"|"08:15:50"
"16"|"25"|"a"|"b"|"
c"|"d"|"e"|"f"|"2453748"|"08:19:50"
"16"|"25"|"a"|"b"|"c"|"d"|"e"|"f"|"2453748"|"08:19:50"
In the... (5 Replies)
Hi everyone!
I'm not new to Unix, but I've never used awk before.
I tried to look up this information on several sites and forums,
I also looked in the documentation but I haven't found a solution yet.
I would like to print the previous 3 lines before and the following 4 lines after the... (6 Replies)
Hi everyboby
this is my problem
I Have this input
1111;222
222
2;333
3333;4444
111;
22222;33
33;
444
and I need this output
1111;2222222;3333333;4444 (15 Replies)
say I'm doing awk 'NR==534'
Is there a way to display 534 535 536 537?
without appending to a variable? per line? maybe an easier way with a different command?
My first impression was NR==534-537 but that would be too easy :P (2 Replies)
Hi.
I need to filter lines based upon matches in multiple tab-separated columns. For all matching occurrences in column 1, check the corresponding column 4. IF all column 4 entries are identical, discard all lines. If even one entry in column 4 is different, then keep all lines.
How can I... (5 Replies)
What is the correct syntax to have the awk parse the next line as well? The next in bold is where I think it should go, but I wanted to ask the experts since I am a beginner. The file to be parsed is attached as well. Thank you :).
awk 'NR==2 {split($2,a,"");b=substr(a,1,length(a-1));print... (6 Replies)
Hello all,
I have a large csv file where there are four types of rows I need to merge into one row per person, where there is a column for each possible code / type of row, even if that code/row isn't there for that person.
In the csv, a person may be listed from one to four times... (9 Replies)