I gotta take a sed swipe at this:
Narrative for sed: delete 10 lines, make line 11 into csv column two without leading spaces and stop before any trailing spaces (assumes never blank, else we can either trim trailing spaces in one more 's' line or 't' detect no sub and sub in a bare comma), discarding the rest of that line, set a loop branch target 'l', get the next line, turn the linefeed and second line into a comma and column 2 as before without white space, quit if line 34, branch to 'l' otherwise. We can work on the raw file since space, comma are not different code in DOS, and maybe we do not need dos2unix unless there are other codes that need fixing; any carriage returns got tossed.
If the files are long, make your first command head?
I threw in some random whitespace that sometimes happens to test.
Output:
DGPickett, yes I meant "tail". Wrong animal
I will performance test your solution vs. the awk one. Unfortunately this will be exported to a cygwin over Win7 environment in final implementation (part of my performance issues)
Mike
Last edited by Michael Stora; 03-15-2013 at 04:02 PM..
Hello fellow unix geeks,
I am having a small dilemna trying to parse a log file I have. Below is a sample of what it will look like:
MY_TOKEN1(group) TOKEN(other)|SSID1
MY_TOKEN2(group, group2)|SSID2
What I need to do is only keep the MY_TOKEN pieces and where there are multiple... (7 Replies)
I have a awk script that parses many millions of lines so performance is critical. At one point I am extracting some variables from a space delimited string.
alarm = $11; len = split(alarm,a," "); ent = a; chem = a; for (i = 5; i<= len; i++) {chem = chem " " a}It works but is slow. Adding the... (7 Replies)
hello,
i have a complex awk problem...
i have two tables, one with a value (0 to 1) and it's corresponding p-value, like this:
1. table:
______________________________
value p-value
... ...
0.254 0.003
0.245 0.005
0.233 0.006
... ...
______________________________
and a... (6 Replies)
I don't know if this is a big issue or not, but I'm having difficulties. I apoligize for the upcoming essay :o.
I'm writing a script, similar to a paint program that edits images, but in the form of ANSI block characters. The program so far is working. I managed to save the image into a file,... (14 Replies)
I have a log file that has many SQL statements/queries/blocks and their resultant output (success or failure) added to each of them. I need to pick up all the statements which caused errors and write them to a separate file.
On most cases, the SQL statement is a single line, like DROP . And if... (1 Reply)
I need help with a problem that I have not been able to figure out.
I have a file that is about 650K lines. Records are seperated by
blank lines, fields seperated by new lines. I was trying to make
a report that would add up 2 fields and associate them with a CP.
example output would be... (11 Replies)